1
내 xamarin.ios 앱에 바코드 스캐너 기능을 추가하려고합니다. Visual Studio에서 개발 중이며 xamarin 구성 요소 저장소의 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 repo에서 ios 샘플을 실행하려고 시도했지만 작동하지 않습니다. 내 ipad 2의 문제 일 수 있습니다 (이 테스트를 사용하고 있습니다)? – Androidian
이것을 따라갈 수 있습니까? https://blog.xamarin.com/barcode-scanning-made-easy-with-zxing-net-for-xamarin-forms/ – unbalanced