Open shashank-shekhar opened 1 year ago
Can you try setting width/height to your ReaderView?
In my case, I did solve this for iOS. As @g0dpain suggested, putting in a specific height and width will get the camera preview to display. That didn't work for me since I need the control to resize. What did work was embedding the reader view in a grid. The grid will set the height and width of the reader view and it does display correctly.
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:zxing="clr-namespace:ZXing.Net.Maui.Controls;assembly=ZXing.Net.MAUI.Controls"
x:Class="App.Views.ScanPage"
>
<Grid>
<zxing:CameraBarcodeReaderView x:Name="barcodeReader"
BarcodesDetected="CameraBarcodeReaderView_BarcodesDetected"
/>
</Grid>
</ContentPage>
@ckrutsinger can you try giving your <zxing:CameraBarcodeReaderView ...> a HeightRequest?
@g0dpain Not necessary. It is working just fine without specifying height or width requests in XAML. The grid component appears to set the h/w appropriately.
@ckrutsinger ah yeah... some might read fully before answering 😒
I can't get the CameraBarcodeReaderView to show up on my iPhone running iOS 16.2 . Renders fine on an Android device, where it doesn't scan ☹️
Markup: