AutoFocus and Torch problems
See original GitHub issueHi, I just finish playing with scanner version 2.4.1 and 3.0.0-beta5. What are the final conclusions:
- finally I succesfully run into autofocus working in version 2.4.1.
- in latest beta version the same setup is not working in Xam.Forms with Prism
- torch working only in newly created and updated nugets sample xamarin forms project.(maybe it is related to project type?)
- so I cannot enable torch in my production project. -autofocus not work first time when permission dialog shows. next time it works fine.
I using Samsung Galaxsy S6.
Here is my page xaml: `
<?xml version="1.0" encoding="utf-8" ?><zxing:ZXingScannerPage xmlns=“http://xamarin.com/schemas/2014/forms” xmlns:x=“http://schemas.microsoft.com/winfx/2009/xaml” xmlns:d=“http://xamarin.com/schemas/2014/forms/design” xmlns:mc=“http://schemas.openxmlformats.org/markup-compatibility/2006” mc:Ignorable=“d” xmlns:prism=“clr-namespace:Prism.Mvvm;assembly=Prism.Forms” prism:ViewModelLocator.AutowireViewModel=“True” xmlns:zxing=“clr-namespace:ZXing.Net.Mobile.Forms;assembly=ZXing.Net.Mobile.Forms” x:Class=“xxx.Views.MAG.MAGScanPage” Title=“Scanning” DefaultOverlayTopText=“Skanowanie” DefaultOverlayBottomText=“Skanowanie działa automatycznie” DefaultOverlayShowFlashButton=“True”> </zxing:ZXingScannerPage> `
DefaultOverlayTopText=“Skanowanie” - Not working. Is here any documentation how to setup module in xaml ? When I setup scanner in *.cs overlay shows text but autofocus is not working.
Torch also not enables in production app… ` protected override void OnAppearing() { base.OnAppearing();
ToggleTorch();
AutoFocus();
}
`
Permissions added:
<uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.FLASHLIGHT" />
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:11 (1 by maintainers)

Top Related StackOverflow Question
Same problem here, zxing’s torch is not working on iOS 13 (package beta 5). Scanner is already initialized, I put a torch button on the custom overlay view which doesn’t work right now.
any news on this? just tried the forms samples and on android autofocus isn’t working. as mentioned by RhomGit after rotating the device autofocus works.