I have Xamarin Forms app. I don't use NavigationBar:
Xamarin.Forms.NavigationPage.SetHasNavigationBar(this, false);
I need change color(background) and text color in status bar for iOS. I use this code:
if (UIDevice.CurrentDevice.CheckSystemVersion(13, 0))
{
UIView statusBar = new UIView(UIApplication.SharedApplication.KeyWindow.WindowScene.StatusBarManager.StatusBarFrame);
statusBar.BackgroundColor = UIColor.White;
statusBar.TintColor = UIColor.Black;
statusBar.AccessibilityIgnoresInvertColors = true;
statusBar.TintColorDidChange();
UIApplication.SharedApplication.KeyWindow.AddSubview(statusBar);
}
else
{
UIView statusBar = UIApplication.SharedApplication.ValueForKey(new NSString("statusBar")) as UIView;
if (statusBar.RespondsToSelector(new ObjCRuntime.Selector("setBackgroundColor:")))
{
statusBar.BackgroundColor = UIColor.White;
statusBar.TintColor = UIColor.Black;
UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.BlackOpaque;
}
}
and I added this code in my info.plist:
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
after this: statusbar background code - white. But text color is white(I need black color). Any advices?