Open rr-rv opened 3 years ago
Hi @rr-rv,
I stumbled across the same issue today. On my Android phone (Samsung Galaxy S10+, Android 11) the ScannerView
showed fine but on an iPad (5th Generation, iPadOS 14.5.1) the camera feed was not displayed although the iPadOS reported active access to the camera.
After extensive searching, I found a hint in the Xamarin Forums with a possible solution to this problem here. It mentions that changing the HorizontalOptions
to FillAndExpand
could help. I set both this and the VerticalOptions
to FillAndExpand
, because I want the camera view to be fullscreen anyway.
In my case, that solution worked. Maybe you give that approach a shot and see whether it solves your issue.
Hope this helps, have a nice day!
Jan
That's my XAML code (but this should work in C#-Code as well):
<Grid VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
<forms:ZXingScannerView ScanResultCommand="{Binding CodeScannedCommand}"
IsScanning="{Binding IsScanning}" Options="{Binding ScanningOptions}"
VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" />
</Grid>
hi @delember
thanks for your idea!!
i did try the fillAndExpand, also putting it inside a StackLayout(and a scroll and a abs layout) and deleting the grid altogether w/o any luck. (as these steps sometimes work in xamarin.forms)
and as you point out, the camera is very much active and getting "read" by the scanner, so the view is somewhere on that page.
i ended up rewriting the solution to use the inbuilt scanner page instead as i could not get the view to work reliably.
versions: ZXing.Net.Mobile 2.4.1 and 3.1.0-beta2 ZXing.Net.Mobile.Forms 2.4.1 and 3.1.0-beta2 Xamarin.Forms 5.0.0.2021 iPad Air 2 14.X (tried ios 14.1 and 14.4) Edit iPhone SE
Setup: ContenPage -> Grid -> ZXingScannerView
ini:
problem On iPad the scanner works, but does not show the camera view.
it works fine on iPhones in ios 14.1 and 14.4 with no problems (and on android as well) edit Just had the chance to test on a more modern iPad (gen 3 pro) where it also works w/o problems. This is getting more and more wierd edit2 Now i have a iPhone SE where the view also dont show.
Expected behavior That the camera preview is shown on iPad
attachemts. file1 is ss from a iPhone file2 is ss from iPad