【问题标题】:ionic cordova barcode scanner - camera not turning on for scan离子科尔多瓦条形码扫描仪 - 相机未打开扫描
【发布时间】:2018-11-09 19:15:12
【问题描述】:

我正在使用 ionic - phonegap-plugin-barcodescanner": "^7.1.2" 进行条码扫描,但是当我单击扫描按钮时 - 相机在 android 模拟器上如下所示。 https://i.stack.imgur.com/e1xL4.png https://i.stack.imgur.com/NS5IB.png

这是我的代码: 扫描() {

this.options = {
  preferFrontCamera: true,
  showFlipCameraButton: true,
  prompt: "scan the barcode here 111"
}

this.barcodeScanner.scan(this.options).then((barcodeData) => {
  this.data = barcodeData;
  console.log(barcodeData);
}, (err) => {
  this.toast.show(err, '5000', 'center').subscribe(
    toast => {
      console.log(toast);
    }
  );
});

}

index.html 有以下..

谁能帮忙看看代码有什么问题。

【问题讨论】:

    标签: ionic-framework cordova-plugins phonegap-plugins barcode-scanner


    【解决方案1】:

    试试这个插件

    <plugin spec="https://github.com/Telerik-Verified-Plugins/BarcodeScanner.git" source="git" />
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多