-
Notifications
You must be signed in to change notification settings - Fork 482
Open
Labels
Description
Is there an existing issue for this?
- I have searched the existing issues
Did you read the "Reporting a bug" section on Contributing file?
- I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug
Current Behavior
When using StatusBarBehavior to change the colors of the status bar on a Modal, it doesn't not apply to the modal but instead to the page behind.
This happens if you do it in the xaml, or if you do it in code, setting ApplyOn also doesn't help.
This is the starting state of the page behind:
This is the modal which should have orange background and dark text:
This is the page behind after closing the modal (which now has the colors that should have been on the modal):
Expected Behavior
When the model page is shown it should apply the status bar colors set.
Steps To Reproduce
- create a new maui project
- add a page with
Shell.PresentationMode="Modal" - add the community toolkit nuget package
- add the following to the modal ContentPage
<ContentPage.Behaviors>
<toolkit:StatusBarBehavior
StatusBarColor="Orange"
StatusBarStyle="DarkContent" />
</ContentPage.Behaviors>
- register the page as a root
Routing.RegisterRoute("modalpage", typeof(ModalPage)); - navigate to the page
await Shell.Current.GoToAsync("modalpage");
-> notice that the status bar colors are not applied to the modal page, but instead are applied to the page behind.
Link to public reproduction project repository
https://github.com/trampster/maui-modal-page-statusbar-bug
Environment
- .NET MAUI CommunityToolkit: 14.0.0
- OS: Android 16
- .NET MAUI: 10.0.30Anything else?
No response
Reactions are currently unavailable