Change Status Bar Color
Changing the status bar style for the entire application
In your Info.plist add the following attribute:
and set its value to
as described in the image below:
In your AppDelegate.swift file, in
didFinishLaunchingWithOptions method, add this code:
The .lightContent option will set the colour of the statusBar to white, for the entire app.
The .default option will set the colour of the statusBar to the original black colour, for the entire app.
Follow the first step from the SWIFT Section. Then add this code to the AppDelegate.m file:
For non-UINavigationBar status bars
- In info.plist set
View controller-based status bar appearanceto
- In view controllers not contained by
UINavigationControllerimplement this method.
For UINavigationBar status bars
Subclass UINavigationController and then override these methods:
Alternatively, you can set
barStyle on the
UIBarStyle options are
blackTranslucent. The latter 3 should all give you a status bar with white text, just the last two specify the opacity of the bar.
Note: you can still change the appearance of your navigation bar as you like.
For ViewController containment
If you are using
UIViewControllerContainment there are a few other methods that are worth looking at.
When you want a child viewController to control the presentation of the status bar (i.e. if the child is positioned at the top of the screen
If you cannot change ViewController's code
If you are using library that contains (for example) AwesomeViewController with a wrong status bar color you can try this: