The49.Maui.BottomSheet
The49.Maui.BottomSheet copied to clipboard
Problem using camera
Hi
Just working through changing our bottom sheets to use this. Looks really good, but just have a small sticking point at the moment with iOS only (works fine in Android).
Our use of this bottom sheet allows the user to take a photo. What I found was that I had to dismiss the bottom sheet for the camera to work (which makes sense). But, I am having trouble showing the bottom sheet again after the photo is taken. I have tried a few different things but here is my current code:
bool hidden = await ClosePostBottomSheet();
bool photoTaken = await TakePhoto();
if (photoTaken)
_ = await ShowPostBottomSheet(true);
ShowPostBottomSheet just has this:
_postPage = new SocialPostBottomSheet(PageUtil.PageBindingContext);
await _postPage.ShowAsync(Window);
return true; // <- Never reaches this line
So even with all these awaits in place it refuses to show. Or to be more precise, it shows for a split second then vanishes again.
If I wait a couple of seconds and tap the button to show the sheet again then it shows, but this involves user input.
Any thoughts on what I should be doing?
Thanks
I'm not too sure about this one. What do you use to pick the photo?
My guess is that there may be another presented view controller used for the camera and it causes issues with the controller of the sheet. But hard to investigate more just from that
Just using MediaGallery to take photos. I think you are right about another view controller being launched for this...
Looks like a new problem in .NET 8. I have a bottom sheet which has a button which shows a popup (DisplayAlert). Used to work in .NET 7 but in .NET 8 the popup doesn't show. The code just hangs. I suspect (wild guess) that it is for the same reason.