Change status bar color in Xamarin.iOS

How to change Xamarin.iOS status bar color

When you create a Xamarin.iOS or Xamarin.Forms mobile application, you'll notice that the status bar color is black by default, and to change it to another color, white for example do the following:

 

1. Open info.plist file and add the following lines just after CFBundleName key

<key>UIStatusBarStyle</key>
<string>LightContent</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>

2. Now open the AppDelegate.cs file and add the following lines just before LoadApplication(new App());

UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.LightContent, false);
UIApplication.SharedApplication.SetStatusBarHidden(false, false);
UINavigationBar.Appearance.TintColor = UIColor.White;

Done!

More about xamarin here

Download Visual Studio here 

هاشتاغ

اترك تعليقاً

Tarek Jihad

Author