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?

0


source to share


2 answers


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

enter image description here



2. StatusBarHidden

Property

Find the code to find links to UIApplication.SharedApplication.StatusBarHidden

and make sure itfalse

enter image description here

+3


source


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/

0


source







All Articles