Open Jensevent opened 1 year ago
Hi,
Sorry, but I can't change the community toolkit pop up behavior. On iOS this control is a UIView with no special requirements, maybe you could set a required width and height for the control...
I am having a similar experience as the OP. Except, I am not using any sort of Popup. Simply a page with a "Start" camera button, the camera opens and fills the page, and I have added a "Cancel" button over the camera view. The button is not clickable when the camera is active.
<AbsoluteLayout>
<Button Text="Start" AbsoluteLayout.LayoutBounds="0, 1, 1, 0.5" AbsoluteLayout.LayoutFlags="All" BackgroundColor="Brown" Command="{Binding StartCamera}" />
<cv:CameraView x:Name="cameraView" IsVisible="{Binding AutoStartPreview}" AbsoluteLayout.LayoutBounds="0, 0, 1, 1" AbsoluteLayout.LayoutFlags="All" BarCodeDetectionEnabled="True" BarCodeOptions="{Binding BarCodeOptions}" BarCodeResults="{Binding BarCodeResults, Mode=OneWayToSource}"
Cameras="{Binding Cameras, Mode=OneWayToSource}" Camera="{Binding Camera}" AutoStartPreview="{Binding AutoStartPreview}" NumCamerasDetected="{Binding NumCameras, Mode=OneWayToSource}" />
<Button Text="Cancel" IsVisible="{Binding AutoStartPreview}" Command="{Binding StopCamera}" AbsoluteLayout.LayoutBounds="0, 0, 0.5, 0.5" AbsoluteLayout.LayoutFlags="All" BackgroundColor="Black" TextColor="White" Opacity="1.0" CornerRadius="0" />
</AbsoluteLayout>
Edit: My issue appears to be more related to https://github.com/hjam40/Camera.MAUI/issues/94 , I will continue my discussion there.
When using the Popups from the Maui community toolkit on iOS, the cameraView takes over all elements, making it impossible to use buttons.
Steps to reproduce:
https://github.com/hjam40/Camera.MAUI/assets/35815436/975f30d7-baa2-42b5-ac67-e4e6d7ce5a6d
On android this will work perfectly fine, but when deploying on iOS the button can not be pressed. When the cameraView is removed, the button can be clicked. It is also possible to click on the background to close the popup, which isnt possible when the CameraView is on the popup. The code for this problem can also be found here (https://github.com/Jensevent/PopUpTest). In this app
myPopup.xaml
is my Community toolkit popup. I am trying to build to an Iphone 7, working from a mac mini with Ventura 13.4. If you need anything more, just ask.