1
我已經成功實現了ngCordova的條碼掃描器,並且它工作正常。但是,每次掃描時,都會彈出一條消息,提示「已複製到剪貼板」。我想擺脫這個信息...任何想法?如何在離子條碼掃描器中禁用「剪貼板」消息
謝謝!
我已經成功實現了ngCordova的條碼掃描器,並且它工作正常。但是,每次掃描時,都會彈出一條消息,提示「已複製到剪貼板」。我想擺脫這個信息...任何想法?如何在離子條碼掃描器中禁用「剪貼板」消息
謝謝!
的溶液設定參數resultDisplayDuration:0.
例:
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: 0, // 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
disableSuccessBeep: false // iOS
}
);
雖然此代碼片段可能會解決問題,但[包括解釋](http://meta.stackexchange.com/questions/114762/explaining-entirely-code-based-answers)確實有助於提高您的質量帖子。請記住,您將來會爲讀者回答問題,而這些人可能不知道您的代碼建議的原因。 – DimaSan