I tried several solutions from SO for this problem but none of them worked for me. I created a new iOS7 project with one simple view. I tried setting
View controller-based status bar appearance to NO
and in AppDelegate:
[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:NO];
However this removes the status bar completely.
Without the View controller-based status bar appearance option, Regardless what I set for Status bar style in the plist file, the status bar text is still black. I need it to be white for the entire application. Is this possible?
I am on latest xcode version.
Step 1: After opening the android studio and creating a new project with an empty activity. Step 2: Navigate to res/values/colors. xml, and add a color that you want to change for the status bar. Step 3: In your MainActivity, add this code in your onCreate method.
To customize it, first pull down the slider bar from the top of the screen. Next, tap on the three vertical dots in the top right corner. Now click on Status bar. You're in.
did you try it without "Animated:No" ?
Go to Info tab of the project target, Add Row:
UIViewControllerBasedStatusBarAppearance, set value NO
Then in appdelegate.m
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
[application setStatusBarStyle:UIStatusBarStyleLightContent];
}
This should set it application wide.
The Accepted answer seemed to work sometimes. I found out that the UIViewController can change the status bar style also. To get around this and always work, cause I didn't need the UIViewControllers controlling the status bar, I had to set UIViewControllerBasedStatusBarAppearance
to NO
in my Info.plist
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With