【问题标题】:phonegap-plugin-barcodescanner freeze on iosphonegap-plugin-barcodescanner 在 ios 上冻结
【发布时间】:2015-12-22 14:22:02
【问题描述】:

我在 OSX 10.11.2 上使用 ionic 版本 1.7.12 和插件 phonegap-plugin-barcodescanner 版本 4.1.0,附加节点版本是 v0.10.26 和 cordova 5.4.1 在 IOS 6+ 上测试,在我之后当我尝试打开扫描仪时,项目会在测试设备上编译并安装 ipa,它会冻结应用程序,要添加的东西是旧版应用程序。

奇怪的是,如果我使用 ionic cli 从头开始​​一个新项目并安装插件,它就可以正常工作。

我应该看的任何地方或我做错了什么。

谢谢

【问题讨论】:

    标签: ios cordova ionic-framework phonegap-plugins


    【解决方案1】:

    “冻结”是什么意思?我有类似的问题,当我通过单击按钮切换条形码扫描仪时,它会打开相机视图并冻结,而“冻结”是指由相机拍摄的图像并且不移动(您仍然可以单击取消按钮并返回返回视图)。

    我发现按钮单击事件一键切换两次,它解释了为什么您的图像没有移动。

    我解决了这个问题。

    $scope.scannerActive = false;
    $scope.scanBarcode = function() {
        if(!$scope.scannerActive) {
            $scope.scannerActive = true;
            $ionicPlatform.ready(function() {
                $cordovaBarcodeScanner.scan().then(
                function(result) {
                    if (!result.cancelled) {
                        console.log(result)
                    }
                    else {
                        console.log('cancelled')
                    }
                },function(error) {
                    alert(JSON.stringify(error));
                }).finally(function() {
                    $scope.scannerActive = false;
                });
            });
        }
    };
    

    【讨论】:

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