Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ccabanero/7944453 to your computer and use it in GitHub Desktop.
Save ccabanero/7944453 to your computer and use it in GitHub Desktop.
iOS - Making the status bar text white in iOS 7
1. In the project's info.plist. Add the key 'View controller-based status bar appearanced' with the value 'NO'.
2. In the Application Delegate's 'didFinishLaunching' add
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
Code snippet ...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
//navigation bar appearance across app
[[UINavigationBar appearance] setBarTintColor: [UIColor colorWithRed:129/255.0 green:200/255.0 blue:244/255.0 alpha:1.0]];
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
//set status bar text style
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
ViewController *viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
viewController.title = @"Observations";
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
[navigationController.navigationBar setTranslucent:YES];
//set navigation bar text color as white
navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor]};
[self.window setRootViewController:navigationController];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
--------------------
OR WITH NO CODE ...
In plist
1. Status bar is initiallhidden | Boolean | NO
2. Status bar style | String | UIStatusBarStyleLightContent
3. View controller-based status bar appearance | Boolean | NO
@aalemayhu
Copy link

👍

@ios4vn
Copy link

ios4vn commented Feb 17, 2016

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment