ZXing在iOS和WindowsPhone

时间:2016-11-09 17:37:27

标签: c# ios mobile windows-phone zxing

我开发了一个移动应用程序,使用Xamarin Forms在C#中扫描QRCode。

我在启动MobileBarCodeScanning iOS和WindowsPhone时遇到问题。

我使用this guide作为示例

主要代码在PCL中,据我所知,必须在每个平台上初始化MobileBarCodeScanning。 Android工作得很好。我在MainActivity.cs中添加了以下代码行:

ZXing.Net.Mobile.Forms.Android.Platform.Init();

该指南还有一个WindowsPhone和iOS示例,它们位于AppDelegate.cs和MainPage.xaml.cs中:

ZXing.Net.Mobile.Forms.iOS.Platform.Init();
ZXing.Net.Mobile.Forms.WindowsPhone.ZXingScannerViewRenderer.Init();

但它在iOS中不起作用并且没有显示错误,当我尝试启动相机时应用程序关闭。 WindowsPhone在ZXing.Net.Mobile.Forms中找不到它,它会出现以下错误:

  

命名空间'ZXing.Net.Mobile.Forms'中不存在类型或命名空间WindowsPhone(您是否缺少和程序集引用?)

在Android上我必须添加在Manifest.xml中使用相机的权限,我没有在其他平台上找到这样的内容。

我还发现了另一种通过Android启动的方法,其代码如下:

ZXing.Mobile.MobileBarcodeScanner.Initialize(Application);

它工作得很好,但其他平台再次出错。我已经尝试再次卸载并安装所有软件包。

可以帮我处理这个案子吗?

0 个答案:

没有答案