You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Setting StatusBarBehavior breaks it on iOS in landscape mode #1707
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?
@RsZoli I have tested this issue as part of the PR here: #1471 and it appears to work. Interestingly I see a status bar in landscape mode though. What iPad are you testing on?
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:
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 StatusBar.UpdateBarSize like so:
#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.
This fixed the issue for me but UpdateBarSize is not an option. I had to use SetBarSize: CommunityToolkit.Maui.Core.Platform.StatusBar.SetBarSize(false);
Activity
bijington commentedon Feb 23, 2024
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?
RsZoli commentedon Feb 23, 2024
@bijington I have tried it, it does fire! On appearing and on orientation changing as well!
bijington commentedon Feb 25, 2024
@RsZoli I have tested this issue as part of the PR here: #1471 and it appears to work. Interestingly I see a status bar in landscape mode though. What iPad are you testing on?
RsZoli commentedon Feb 25, 2024
@bijington I'm testing only on iPhones.
brendan-holly-modea commentedon Apr 9, 2024
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.
randyburden commentedon May 29, 2024
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:
I was able fix the issue by subscribing to display info changes and calling
StatusBar.UpdateBarSizelike so:Some form of the above code should be incorporated into this library to fix the issue.
thedee commentedon Mar 20, 2025
This fixed the issue for me but UpdateBarSize is not an option. I had to use SetBarSize:
CommunityToolkit.Maui.Core.Platform.StatusBar.SetBarSize(false);Similar reports:
#1193
iob-ubp commentedon Dec 16, 2025
The issue is still present with net10.0-ios 26.1 :
The workaround of @thedee is still working for me, thanks.
Workload version: 10.0.100.1
Installed Workload Id Manifest Version Installation Source
maui-android 10.0.0/10.0.100 SDK 10.0.100
maui-ios 10.0.0/10.0.100 SDK 10.0.100