Forum Xamarin Xamarin.Forms

AlertDialog in scanning mode (ZXing.Mobile bar code scanner)

Please, help!
AlertDialog is displayed in MainActivity.
How to draw a conclusion in barCodeLayout?

My code:
public void TestLV_ItemClick(object sender, ItemClickEventArgs e)
var scanner = new MobileBarcodeScanner();
var opt = new MobileBarcodeScanningOptions
DelayBetweenContinuousScans = 3000
scanner.UseCustomOverlay = true;
var barCodeLayout = LayoutInflater.FromContext(this).Inflate(Resource.Layout.BarCodeLayout, null);
scanner.CustomOverlay = barCodeLayout;
Button enter = scanner.CustomOverlay.FindViewById<Button>(Resource.Id.btnIn);
enter.Click += delegate (Object o, EventArgs ex) {
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.SetTitle("Scanning Mode");
alert.SetMessage("Go to INPUT scan mode?");
alert.SetPositiveButton("Yes", (senderAlert, args) => {
Toast.MakeText(this, "Scanning of INPUTS", ToastLength.Short).Show();
InOut = "Input";
(o as Button).SetBackgroundColor(Color.SeaGreen);
Dialog dialog = alert.Create();
scanner.ScanContinuously(opt, HandleScanResult);

Sorry for my English.

Sign In or Register to comment.