Xamarin iOS status bar text color
I cannot change the color of the text in the status bar of my XAMAIN Forms iOS app to white. I've already tried several solutions found online and Stack Overflow and none of them worked for me. This is what I did:
- Update my info.plist where I added boolean property View dashboard status bar> and set it to No / False
- I added in App.cs, in my MainPage, which is NavigationPage, BarTextColor = Color.White
The problem is that now I no longer have the status bar and in the case when I remove the property added to info.plist the color of the text in the status bar remains black. Is there something I can't see?
source to share
There are several ways to hide the iOS status bar. Here's what to check in the Xamarin.iOS source code:
1. Setting up Info.plist
In Info.plist
make sure that Status bar is initially hidden
-No
2. StatusBarHidden
Property
Find the code to find links to UIApplication.SharedApplication.StatusBarHidden
and make sure itfalse
source to share
Change status bar color:
in App.xaml.cs:
MainPage = new NavigationPage(new MainPage())
{
BarBackgroundColor = Color.FromHex("Your color code here"),
BarTextColor = Color.White
};
in Info.plist
:
<key>UIViewControllerBasedStatusBarAppearance</key>
check this url: http://www.fabiocozzolino.eu/change-ios-status-bar-color-xamarin-forms/
source to share