When I launch my app, it shows the launch image and a black status bar. How can I change it so the status bar is light during launch? I have set the status bar appearance to light in my AppDelegate didFinishLoading method, and it works for the rest of the app.
53
votes
6 Answers
109
votes
19
votes
There are 2 steps:
This is usually what developers know how to do – Under Target settings > General > Status Bar Style > Change to Light. This will effect the Info.plist to include
UIStatusBarStyleLightContent
.This step is often missed out – In Info.plist, add
View controller-based status bar appearance
and set to NO
11
votes
3
votes
2
votes
Works on iOS7 and iOS8
You need to set in your Info.plist file property for key
Status bar style
:
- Set
Opaque black style
orTransparent black style (alpha of 0.5)
for White status bar - Set
Gray style (default)
to set Black status bar color.
It looks like you set Background style for Status Bar and XCode understand which color of status bar need to choose. Dark background - white status bar, light background - black status bar
0
votes
**
- You must take care of these three things:
**
**- In info.plist file**
Set UIViewControllerBasedStatusBarAppearance to YES
**- In your view controller** in which you want change color of status bar
add this [self setNeedsStatusBarAppearanceUpdate] in viewDidLoad
**- Lastly, add this method**
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}
Note: If you want to set color of statusBar for all the View Controllers then steps are
**- In info.plist file**
Set UIViewControllerBasedStatusBarAppearance to YES
**- Then add this in appDelegate**
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent; // **It is deprecated in iOS 9**