|

楼主 |
发表于 2017-4-3 18:34:07
|
显示全部楼层
本帖最后由 KingLin 于 2017-4-3 18:38 编辑
我上面说的横向,纵向是指手机的屏幕。 手机屏幕横向时,二维码扫描预览框较大,但是影响了我软件的界面的其它布局了,所以还是希望屏幕竖着扫。
以下是6.05版的方法调用参数:
cordova.plugins.barcodeScanner.scan(
function (result) {
alert("We got a barcode\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
showTorchButton : true, // iOS and Android
torchOn: true, // Android, launch with the torch switched on (if available)
prompt : "Place a barcode inside the scan area", // Android
resultDisplayDuration: 500, // Android, display scanned text for X ms. 0 suppresses it entirely, default 1500
formats : "QR_CODE,PDF_417", // default: all but PDF_417 and RSS_EXPANDED
orientation : "landscape", // Android only (portrait|landscape), default unset so it rotates with the device
disableAnimations : true // iOS
}
);
|
|