ionic-framework - 离子科尔多瓦条形码扫描仪 - 相机未打开扫描
问题描述
我正在使用 ionic - phonegap-plugin-barcodescanner": "^7.1.2" 进行条形码扫描,但是当我单击扫描按钮时 - 相机在 android 模拟器上如下所示。https: //i.stack.imgur.com /e1xL4.png https://i.stack.imgur.com/NS5IB.png
这是我的代码:scan() {
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 具有以下内容.. < ion-app style="background: none transparent !important;">
任何人都可以请帮助代码有什么问题。
解决方案
尝试使用这个插件
<plugin spec="https://github.com/Telerik-Verified-Plugins/BarcodeScanner.git" source="git" />
推荐阅读
- c# - 如何在作为类属性的谓词中使用类属性?
- androidx - Android Studio 在构建 gradle 时迁移到 androidx 后卡在 :app:transformdexarchivewithdexmergerfordebug
- python - 每个测试的 Python unittest 单独的 setup() 方法
- python - 我无法以厘米为单位获得高度的小数值,它只给出圆形输出
- docker - 在单独的容器中为配置服务器和服务运行 vespa
- mysql - 2个表格查询并花费一个值
- javascript - Javascript - XMLHttpRequest 接收 null
- sql-server - 从多条记录中获取第一个日期记录
- angular - createUrlTree 忽略“useHash: true”RouterModule 配置
- jquery - 无法让 Flot 条形图并排呈现