In iOS 9, how do I change the color of the status bar text to white?
-
you shouldnt customise the status bar. Choose one of the status bar style available. The text color should be white, when the statusbar is on dark background. – Teja Nandamuri Oct 13 '15 at 13:29
-
please check my answer and tell me review @reza_darkman797 – Jay Bhalani Oct 13 '15 at 13:56
-
2On iOS9 just this in the AppDelegate works... ```[[UINavigationBar appearance] setBarStyle:UIBarStyleBlack];``` – Dimitris Apr 28 '16 at 17:01
-
Heads up - `setStatusBarStyle` is deprecated on iOS 9... use `preferredStatusBarStyle` instead. – siege_Perilous Jun 02 '16 at 23:56
-
THE STATUS BAR CONTENT IS BASED ON NAVIGATION CONTROLLER BAR STYLE. SO ALL YOU NEED TO DO IS JUST ADD THE LINE IN YOUR ViewDidLoad(): [self.navigationController.navigationBar setBarStyle:UIBarStyleBlack]; Default is Black. ie, [self.navigationController.navigationBar setBarStyle:UIBarStyleDefault]; – Ram Madhavan Sep 07 '17 at 06:00
6 Answers
If you want to change Status Bar Style from the launch screen, You should take this way.

- 5,432
- 1
- 21
- 26
-
2Status Bar Style's dropdown is missing in xcode 7.2. Where I can find it? – Sonic Master Feb 19 '16 at 07:03
-
@SonicMaster I don't know why you don't find it. I can see it in xcode 7.2 ?_? – Wanbok Choi Feb 19 '16 at 13:58
-
3@WanbokChoi, it was my fault. If you set your target to ipad/iphone only instead of universal, that dropdown will disappear. Thank you. – Sonic Master Feb 21 '16 at 04:34
-
3For iOS 10 you also need to add this code on every ViewController : - (UIStatusBarStyle)preferredStatusBarStyle { return UIStatusBarStyleLightContent; } – mwaqas01 Dec 30 '16 at 10:29
-
@mwaqas01 You don't need. Just set `View controller-based status bar appearance` in `plist`. It works for me. – Kamil Harasimowicz Jul 17 '17 at 13:24
-
The key for the .plist file is UIViewControllerBasedStatusBarAppearance – Alessandro Mulloni Oct 12 '17 at 07:34
-
-
1`UIViewControllerBasedStatusBarAppearance` to `false` was the missing ingredient for me - thanks! – sherb Jul 31 '19 at 22:15
Using a UINavigationController
and setting its navigation bar's barStyle
to .Black
. past this line in your AppDelegate.m
file.
navigationController.navigationBar.barStyle = UIBarStyleBlack;
If you are not using UINavigationController
then add following code in your ViewController.m
file.
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}
And call the method to this line :
[self setNeedsStatusBarAppearanceUpdate];

- 4,142
- 8
- 37
- 50
First set
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
Go to your AppDelegate, find itsdidFinishLaunchingWithOptions
method and do:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
}
and then set View controller-based status bar appearance
equal to NO in plist.

- 33,269
- 19
- 164
- 293

- 6,230
- 7
- 56
- 82
-
6Adding the entry to the plist is the most important part of this answer, without this then you won't be able to set the style on individual views – sam_smith Dec 21 '15 at 00:26
-
23
-
4Since iOS 9, this method is deprecated. Use the ViewController method instead : - (UIStatusBarStyle)preferredStatusBarStyle {return UIStatusBarStyleLightContent;}` You will also need to add this key in your Info.plist : "UIViewControllerBasedStatusBarAppearance" – Hugo Jan 06 '16 at 18:53
-
Got it Working in Xcode 8 -iOS10 (through the project properties Statusbar: Light and in the plist ViewController-based status bar appearance: NO.Perfect Thanks – Remco Nov 21 '16 at 20:44
Add a key in your
info.plist
fileUIViewControllerBasedStatusBarAppearance
and set it toYES
.In viewDidLoad method of your ViewController add a method call:
[self setNeedsStatusBarAppearanceUpdate];
Then paste the following method in
viewController
file:- (UIStatusBarStyle)preferredStatusBarStyle { return UIStatusBarStyleLightContent; }

- 6,091
- 2
- 32
- 34

- 511
- 5
- 14
-
1This is what I wanted because I only want to change the style for that one view controller. – Mr Rogers Feb 19 '16 at 02:18
-
1you can also just set the status bar style in the ViewController's .xib (i.e. instead of adding the prefferedStatusBarStyle method) – Chris Allinson Nov 17 '16 at 17:34
-
for UIStatusBarStyleLightContent, you can also select Light in the General Tab after you select your project. No code required. – coolcool1994 Feb 16 '18 at 05:48
Add the key View controller-based status bar appearance
to Info.plist
file and make it boolean type set to NO
.
Insert one line code in viewDidLoad
(this works on specific class where it is mentioned)
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;

- 4,750
- 4
- 35
- 64

- 1,419
- 1
- 13
- 23
-
1`statusBarStyle` is readonly: `@property(readonly, nonatomic) UIStatusBarStyle statusBarStyle` in iOS9. And `setStatusBarStyle` is deprecated – zxcat Feb 25 '16 at 13:48
iOS Status bar has only 2 options (black and white). You can try this in AppDelegate:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
[[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleLightContent];
}

- 13,044
- 8
- 95
- 91

- 61
- 6
-
1'setStatusBarStyle:' is deprecated: first deprecated in iOS 9.0 - Use -[UIViewController preferredStatusBarStyle] – omega1 Feb 14 '18 at 09:53