This question already has an answer here:
- How to change Status Bar text color in iOS 51 answers
How to change Status Bar text color in iOS 9.
How can I change the status bar text color to white
Please help me.
Thank you.
This question already has an answer here:
How to change Status Bar text color in iOS 9.
How can I change the status bar text color to white
Please help me.
Thank you.
If you follow reza's method, Launch screen is still black.
This method is better.
Go to Project
-> Target
,
Set Status Bar Style
to Light
Set View controller-based status bar appearance
to NO
in Info.plist
.
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];
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.
Add a key in your info.plist
file UIViewControllerBasedStatusBarAppearance
and set it to YES
.
In viewDidLoad method of your ViewController add a method call:
[self setNeedsStatusBarAppearanceUpdate];
Then paste the following method in viewController
file:
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}
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;
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];
}