I've downloaded and built the Sample.Forms project but when I run it, the "Scan With Custom Page" option does not show any of the top or bottom text on the page. Only the flash button shows up.
I've tried digging through the source for the ZXingScannerView and ZXingDefaultOverlay but I'm not familiar with Xamarin enough to figure out where the problem lies.
I have exactly the same issue.
I've made a sample project here to demonstrate the issue.
Also the flash light toggle is not working.
https://github.com/frankfolsche/Barcode-Scanning-Android-UWP-iOS
It seems that the overlay controls try to bind to the page instead of binding to the overlay. You can do this to fix it, but then you have to manage the flash button click (or hide it):
var overlay = new ZXingDefaultOverlay
{
ShowFlashButton = false,
TopText = "I'm at the top",
BottomText = "I'm at the bottom",
};
overlay.BindingContext = overlay;
ScannerPage = new ZXingScannerPage(null, overlay);
That indeed does work, I hope they fix this is a coming release.
Thanks for the help
Same here.
I have problem, cause if I set Overlay's BindingContext to itself, HasTorch returns false.
How can I fix this error?
An example is
var overlay = new ZXingDefaultOverlay
{
BottomText = Strings.ClickToFocus,
};
overlay.BindingContext = overlay;
var scanPage = new ZXingScannerPage(barcodeScanOptions, overlay);
overlay.ShowFlashButton = scanPage.HasTorch;
Most helpful comment
It seems that the overlay controls try to bind to the page instead of binding to the overlay. You can do this to fix it, but then you have to manage the flash button click (or hide it):