Customize the scanning overlay
masterBy default, the library provides a simple overlay with a horizontal red line and semi-transparent borders. To use a custom UI, you must provide a platform-specific view and set UseCustomOverlay to true.
Note: When using a custom overlay, you are responsible for the entire overlay; you cannot mix custom elements with the default one. The type of the CustomOverlay property varies by platform:
- Xamarin.iOS:
UIView - Xamarin.Android:
View - UWP:
UIElement
var scanner = new ZXing.Mobile.MobileBarcodeScanner();
scanner.UseCustomOverlay = true;
scanner.CustomOverlay = myCustomOverlayInstance;
var result = await scanner.Scan();var scanner = new ZXing.Mobile.MobileBarcodeScanner();
scanner.UseCustomOverlay = true;
scanner.CustomOverlay = myCustomOverlayInstance;
var result = await scanner.Scan();
//Handle result