Search code examples
iosstatusbarxamarin.formsmaster-detail

Xamarin.Forms iOS statusbar color with NavigationPage


I am building an application in Xamarin.Forms, on the iOS app I want the status bar color to be white. Here is what I have so far:

App.cs

public App()
{
    NavigationPage _navigationPage = new NavigationPage(new RootPage());

    MainPage = _navigationPage;
}

Solution

  • After a recent Xamarin update you are now able to do this by setting the BarTextColorProperty,

    _navigationPage.SetValue(NavigationPage.BarTextColorProperty, Color.White);

    However just like in pvnak's answer you still need to add the following to your Info.plist

    • Property: UIViewControllerBasedStatusBarAppearance
    • Type: boolean
    • Value: No