1

How do I avoid hiding the Status Bar on Xamarin.iOS when changing its text color?

After trying to change the color of my iOS Status Bar, I don't have a status bar anymore.

I remove the property I added in info.plist, but then my status bar text color remains black.

This is what I did, following these steps:

  • Updated info.plist adding the boolean property View Controller-Based Status Bar Appearance and set it to No
  • Added in the App.cs, in my MainPage which is a NavigationPage, BarTextColor = Color.White
Brandon Minnick
  • 13,342
  • 15
  • 65
  • 123
Huby03
  • 801
  • 2
  • 14
  • 28

2 Answers2

3

There are a couple ways to hide the iOS Status Bar. Here are the things to verify in the Xamarin.iOS source code:

1. Info.plist Setting

In the Info.plist, ensure that Status bar is initially hidden is No

enter image description here

2. StatusBarHidden Property

Search the code to find any references to UIApplication.SharedApplication.StatusBarHidden and ensure that it is false

enter image description here

Community
  • 1
  • 1
Brandon Minnick
  • 13,342
  • 15
  • 65
  • 123
1

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/

Manish Sharma
  • 2,406
  • 2
  • 16
  • 31
Pratik
  • 720
  • 4
  • 20