1

I have a navigation bar implemented in my iOS App and I set the tint-color to white but when running the app, the status bar does not follow the tint-color and is just transparent (see image). I'm aiming for the status bar to have the translucent style to it.

How to fix this?

enter image description here

Lorenzo
  • 3,293
  • 4
  • 29
  • 56
Renz Tan
  • 245
  • 3
  • 10
  • Possible duplicate of [Changing status bar style ios 7?](http://stackoverflow.com/questions/19447137/changing-status-bar-style-ios-7) – Badal Shah Oct 13 '15 at 10:07

3 Answers3

4

To change the the status bar color in all the Viewcontrollers, add this to your info.plist

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

then clean and run the build.

For setting status bar color specific to ViewControllers add the following in the info.plist

<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>

And in the viewDidLoad method of ViewController call this method :

[self setNeedsStatusBarAppearanceUpdate];

And the add the following method in ViewController :

- (UIStatusBarStyle)preferredStatusBarStyle
{ 
    return UIStatusBarStyleLightContent; 
}

Cheers :]

Chengappa C D
  • 1,841
  • 1
  • 12
  • 19
2

Have you already tried this?

UIApplication.sharedApplication().statusBarStyle = .LightContent
2

Try this

[self setNeedsStatusBarAppearanceUpdate];//add it in view didload

- (UIStatusBarStyle) preferredStatusBarStyle { 
        return UIStatusBarStyleLightContent; 
   }

Check the Links add the view in status bar check next link

Community
  • 1
  • 1
HariKrishnan.P
  • 1,204
  • 13
  • 23