简体   繁体   中英

ZXing.Net.Mobile not working in Xamarin iOS

I installed ZXing.Net.Mobile in my Xamarin.Forms project. I have no issue with Android project as I am using MobileBarcodeScanner.Initialize (Application); in MainActivity. But in my iOS project I am trying to use global::ZXing.Net.Mobile.Forms.iOS.Platform.Init(); which is not accessiblein AppDelegate.cs file. I import following packages :

using System;
using System.Collections.Generic;
using System.Linq;
using ZXing.Mobile;
using Foundation;
using UIKit;

You have either the wrong library or not all you need. Take a look at this: 移动条形码扫描的参考和导入


After that the initialization is as easy as:

 scanner = new MobileBarcodeScanner();
        scanner.BottomText = "Der Barcode wird automatisch gescannt";
        scanner.TopText = "Bringen Sie den Barcode in die Mitte des Bildschirms";
        scanner.CancelButtonText = "Abbrechen";
        scanner.FlashButtonText = "Licht"; 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM