【问题标题】:Phonegap BarcodeScanner.js can't close on iosPhonegap BarcodeScanner.js 无法在 ios 上关闭
【发布时间】:2023-04-07 01:57:01
【问题描述】:

感谢您的帮助! 我正在尝试在带有 Xcode 6.2 的 ios 上使用最新版本的 BarcodeScanner (https://github.com/wildabeast/BarcodeScanner/) 和 ponegap。它效果很好,扫描时给我很好的结果,但是当我尝试通过单击“取消”离开相机模式时,它不起作用!我到处搜索,我找不到解决方案:/ 这是我的代码(非常基本) html:

 <body>
    <input type="button" id="scanButton" value="SCAN" />
    <div class="content">

    </div>

    <script type="text/javascript" src="cordova.js"></script>
    <script type="text/javascript" src="barcodescanner.js"></script>
    <script src="js/jQuery1.11.js"></script>
    <script type="text/javascript" src="js/index.js"></script>
</body>

js

    $("#scanButton").click(function(){
    scanWithCordova();
});

function scanWithCordova(){
    cordova.plugins.barcodeScanner.scan(
        function (result) {
            $('.content').html("We got a barcode\n" +
                  "Result: " + result.text + "\n" +
                  "Format: " + result.format + "\n" +
                  "Cancelled: " + result.cancelled);
        }, 
        function (error) {
            alert("Scanning failed: " + error);
        }
    );
}

【问题讨论】:

    标签: javascript ios cordova mobile phonegap-plugins


    【解决方案1】:

    像这样从 GIT 存储库安装它:

    phonegap plugin add https://github.com/phonegap/phonegap-plugin-barcodescanner.git
    

    它修复了它或我。我认为安装包中还没有发布一些错误修复。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多