The49.Maui.BottomSheet
The49.Maui.BottomSheet copied to clipboard
AppShell menu opening behind sheet on iOS
I've been able to keep the background interactive on iOS by adding the Medium detent and LargestUndimmedDetentIdentifier property in the Showing event handler.
The issue I have now is that the sheet is always in front of the entire AppShell view controller. I can close it on navigating away from the view I want it visible on, but I can't find a way to place it behind the flyout menu or hide it on opening the menu. Any ideas?
Hi,
Nice workaround for the custom detent issue on iOS.
Because this uses the native iOS sheets, I don't believe it is possible to have any other view over the sheet
If you want to close the sheet when you menu opens you should be able to call Dismiss
on the sheet
I will dig into the implementation of the flyout on iOS to see if it is possible to change the viewController that presents the bottomsheet
Thanks. I did try changing the ViewController that the present method was called on in the the iOS handler but I couldn't get it to work, I tried walking down the children from the top most one and calling on each. Either it didn't show or went over everything.
I've not actually tested it in Swift to see if it would do what I want natively.
I was hoping I could do something like the Apple Find My app where the sheet goes behind a tab bar.
I have tried something similar. I managed to get the flyout's viewcontroller an present from there but it always shows on top.
I suspect the flyout is just a view that slides in inside the shell view, not a view attached to the window as this line suggests: https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellFlyoutRenderer.cs#L442
I'm not sure we can do more from within this plugin. Maybe it is possible to move the flyout renderer's view but it might cause a series of issues.
While not the ideal option, Observing the IsOpen of the flyout and closing/re-opening the sheet might be the only way for now
Thanks for looking into it. I'll go with the property observer on the flyout.
One thing that might help, could we have an overload on Show and Dismiss to set the animated boolean? If I can disable the animation it might make it less obvious that I'm hiding and showing it. I might even be able to use CaptureAsync to swap the sheet for an image in the parent view that will happily sit behind the menu.
I'll have a look to see if this is the same on Android. I suspect we can actually put in behind the flyout on Android as the sheet is added to the coordinator layout.
If that is the case and you do find a solution using CaptureAsync for iOS I'd be interested in integrating that into the plugin
rc1 was just released with an extra parameter added to both ShowAsync
and DismissAsync
to control the animations
Dialogs like Application.Current.MainPage.DisplayActionSheet
also open behind the BottomSheets.
I have the same problem on Android. Could you tell me how the problem was solved?
I have the same problem on Android. Could you tell me how the problem was solved?
I gave up and rolled my own using a pan gesture and some simple animations. I wanted something that worked like the bottom sheet in Google Maps app, and this library isn't that.