1
xamarin.iosアプリにバーコードスキャナ機能を追加しようとしています。私はVisual Studioから開発しています。私は、xxarinコンポーネントストアからZxing.Net.Mobileコンポーネントを追加しました。Xamarin.iOS ZXing.Net.Mobileバーコードスキャナ
ScanButton.TouchUpInside += async (sender, e) => {
//var options = new ZXing.Mobile.MobileBarcodeScanningOptions();
//options.AutoRotate = false;
//options.PossibleFormats = new List<ZXing.BarcodeFormat>() {
// ZXing.BarcodeFormat.EAN_8, ZXing.BarcodeFormat.EAN_13
//};
var scanner = new ZXing.Mobile.MobileBarcodeScanner(this);
//scanner.TopText = "Hold camera up to barcode to scan";
//scanner.BottomText = "Barcode will automatically scan";
//scanner.UseCustomOverlay = false;
scanner.FlashButtonText = "Flash";
scanner.CancelButtonText = "Cancel";
scanner.Torch(true);
scanner.AutoFocus();
var result = await scanner.Scan(true);
HandleScanResult(result);
};
void HandleScanResult(ZXing.Result result)
{
if (result != null && !string.IsNullOrEmpty(result.Text))
TextField.Text = result.Text;
}
問題は、私はスキャンボタンをタップすると、キャプチャビューが正しく表示されていることですが、私は捕獲しようとした場合、バーコード何も起こらないと:サンプルに示すように
私はそれを実装しましたスキャナがバーコードを認識しないようです。
誰かがこの問題を経験しましたか?どのように私はそれを働かせることができますか?
ご協力いただきありがとうございます。
あなたはここにしようとしたのですか? https://components.xamarin.com/gettingstarted/zxing.net.mobileサンプルコードがあります(私はバーコードスキャナーでの経験は一度もありません) – unbalanced
はい、サンプルコードに従っていますが動作しません。私はgithubリポジトリからiosサンプルを実行しようとしましたが、それもうまくいきません。それは私のipad 2(私はテストするためにこれを使用している)の問題かもしれません? – Androidian
これをフォローできますか? https://blog.xamarin.com/barcode-scanning-made-easy-with-zxing-net-for-xamarin-forms/ – unbalanced