1
我在做與PhoneGap的插件上的QR碼讀取一些測試 https://github.com/phonegap/phonegap-plugin-barcodescannerPhoneGap的條碼掃描器肖像模式
我到index.js
cordova.plugins.barcodeScanner.scan(
function (result) {
alert("We got a barcode not \n" +
"Result: " + result.text + "\n" +
"Format: " + result.format + "\n" +
"Cancelled: " + result.cancelled);
},
function (error) {
alert("Scanning failed: " + error);
},
{
"preferFrontCamera" : true, // iOS and Android
"showFlipCameraButton" : true, // iOS and Android
"prompt" : "Place a barcode inside the scan area", // supported on Android only
"formats" : "QR_CODE,PDF_417", // default: all but PDF_417 and RSS_EXPANDED
"orientation" : "portrait" // Android only (portrait|landscape), default unset so it rotates with the device
}
);
一切似乎工作除了這部分安裝的代碼,似乎並沒有觸發。 我需要掃描儀爲縱向,但始終處於橫向模式。
{
"preferFrontCamera" : true, // iOS and Android
"showFlipCameraButton" : true, // iOS and Android
"prompt" : "Place a barcode inside the scan area", // supported on Android only
"formats" : "QR_CODE,PDF_417", // default: all but PDF_417 and RSS_EXPANDED
"orientation" : "portrait" // Android only (portrait|landscape), default unset so it rotates with the device
}
我建立在PhoneGap的的Adobe構建應用程序,並安裝在Android 6.0.1 有什麼我錯過了還是做錯了什麼?