Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit e7031af

Browse files
Update status bar size when rotating (#1639)
Co-authored-by: Gerald Versluis <[email protected]>
1 parent 9a10b8f commit e7031af

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/CommunityToolkit/Xamarin.CommunityToolkit/Effects/StatusBar/PlatformStatusBarEffect.ios.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ protected override void OnDetached()
2727
protected override void OnElementPropertyChanged(PropertyChangedEventArgs args)
2828
{
2929
base.OnElementPropertyChanged(args);
30-
if (args.PropertyName == StatusBarEffect.ColorProperty.PropertyName)
30+
if (args.PropertyName == StatusBarEffect.ColorProperty.PropertyName
31+
|| args.PropertyName == View.HeightProperty.PropertyName
32+
|| args.PropertyName == View.WidthProperty.PropertyName)
3133
{
3234
SetColor(StatusBarEffect.GetColor(Element));
3335
}
@@ -50,6 +52,7 @@ static void SetColor(Color color)
5052
statusBar.Tag = statusBarTag;
5153
statusBar.BackgroundColor = uiColor;
5254
statusBar.TintColor = uiColor;
55+
statusBar.Frame = UIApplication.SharedApplication.StatusBarFrame;
5356
window.AddSubview(statusBar);
5457

5558
UpdateStatusBarAppearance(window);

0 commit comments

Comments
 (0)