Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 11450 [details]
If a page is shown using NavigationPage.PushModalAsync(...) while an Alert or Actionsheet is being displayed, it will appear behind the Alert/Actionsheet.
**Steps to Reproduce:**
1. Run the attached sample on Android
2. Tap the button to show an Alert
3. Wait 1 second
4. Observe the Modal page shown underneath
The modal is shown behind the alert/actionsheet.
The alert/actionsheet should be closed/dismissed so that the modal page is shown on top.
**Build Date & Platform:**
iOS produces the expected behavior.
There does not seem to be a way to programmatically dismiss these alerts/actionsheets to work around this before showing a modal page.
In addition to alerts and actionsheets, pickers (and date pickers) also show over modal pages in a similar way. The original attached project included an example of this behavior.
This is expected behavior.
If this is expected behavior, then I don't see how it's possible to do something like push a login page after a timeout period if the user _might_ have an action sheet open (since the action sheet would display _on top of_ the pushed login page). Am I correct? Is there a recommended workaround?
You could work around this by making sure to dismiss any open actionsheets/alerts/pickers before pushing the modal page.
Thanks for your response, John. I was unable to find a way to programmatically dismiss actionsheets, pickers, and alerts. How can I do this?
Sorry for the confusion!
I don't think Forms has something packaged with it. I was using a different library that had a display/dismiss method. You could implement this too using the dependency service so that you have access to the dismiss methods on a UIAlertView, etc.
On Android, I was unable to find a solution for dismissing programmatically, even using a custom renderer. The few solutions I found for native Android did not work in a Forms custom renderer. So currently, I'm unaware of any way to programmatically dismiss actionsheets, alerts, and pickers in Xamarin.
It seems that if this is indeed expected behavior for Xamarin, there should be a way to programmatically dismiss these windows in each platform. Could you provide any documentation or help on how to do this on both iOS and Android?