BarcodeScanner.Mobile icon indicating copy to clipboard operation
BarcodeScanner.Mobile copied to clipboard

CameraView overlapping other views in MAUI (.NET8)

Open stepkillah opened this issue 1 year ago • 3 comments
trafficstars

Describe the bug In MAUI version there are some issues with properly displaying CameraView.

To Reproduce Steps to reproduce the behavior:

  1. Open MAUI Sample App
  2. Open MVVM Demo page
  3. See that CameraView is overlapping over controls

Expected behavior CameraView should be displayed correctly in specified sizes, and Preview should fill available space, and crop what's out of the bounds. See Xamarin Forms screenshot

Screenshots MAUI Screenshot_1701623966 Xamarin Forms Screenshot_1701624031

Smartphone (please complete the following information):

  • Device: Google Pixel
  • OS: Android
  • Version Maui v8.0.0 (may be on previous too, haven't tested)

Additional context I was trying to find what causes it and created PR to use the new ResolutionSelector, but it didn't fix the issue.

If set _previewView.SetScaleType(PreviewView.ScaleType.FitCenter) in CreatePlatformView - it affects this behavior, but it is not a fix, because it starts to fit the preview instead of filling

Known workarounds

Wrap CameraView into Frame and set ClipToBounds = true , but other issues appear like black camera view after the first scan.

stepkillah avatar Dec 03 '23 17:12 stepkillah

Can confirm, the camera view does all sorts of craziness.

Quaybe avatar Dec 14 '23 22:12 Quaybe

A partial workaround is to wrap CameraView into Frame and set ClipToBounds = true , but other issues appear like a black camera view after first scan.

stepkillah avatar Dec 15 '23 11:12 stepkillah