-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Setting StatusBarBehavior breaks it on iOS in landscape mode #1707
Comments
Debugging this in my head I suspect the SizeChanged event isn't firing from the page when the orientation changes. I wonder if that is a change in MAUI? @RsZoli Are you able to subscribe to the SizeChanged event in your page, change the orientation and see if it fires? |
@bijington I have tried it, it does fire! On appearing and on orientation changing as well! |
@bijington I'm testing only on iPhones. |
Is this still an issue on version 8 of the community toolkit? I'm also seeing this behavior on .net7 with version 6.1 of this package, so it doesn't appear to be a new issue to version 7.0.1 of the package. |
I am using version 9.0.0 of the CommunityToolkit.Maui package and am also experiencing this issue. My app is using MAUI Blazor Hybrid and once I change the status bar color on iOS, if I change to landscape mode, then I get the same reported behavior of where there is a colored rectangle at the top of the page that takes up about 45% of the width of the page. When the device rotates to a vertical orientation the issue goes away and when I rotate back to a horizontal orientation the issue appears again. Here is an example of how I'm changing the status bar: CommunityToolkit.Maui.Core.Platform.StatusBar.SetColor(Colors.Red);
CommunityToolkit.Maui.Core.Platform.StatusBar.SetStyle(StatusBarStyle.LightContent); I was able fix the issue by subscribing to display info changes and calling #if IOS
DeviceDisplay.Current.MainDisplayInfoChanged += (sender, e) =>
{
CommunityToolkit.Maui.Core.Platform.StatusBar.UpdateBarSize();
};
#endif Some form of the above code should be incorporated into this library to fix the issue. |
Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
When setting a ContentPage's StatusBarBehavior on a page like this:
Navigating to another page and turn the phone to landscape mode, the result is this:
However, after navigating to another page that has the StatusBarBehavior setting, there is no problem:
Expected Behavior
The StatusBarBehaviour should be needed to set one time only, and have no issue after navigating from the page it has set on.
Steps To Reproduce
Please find it in my repository
Link to public reproduction project repository
https://github.com/RsZoli/GitHubRepros
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: