iOS

Everything About UIStatusBar

Previously we mentioned a common pitfall with using a light style status bar.

This is more to understanding how to properly use UIStatusBar.

Info.plist

You already know the 2 settings in the project/target setting, or in Info.plist. There’s one more (see 3rd point).

  1. UIStatusBarStyle – Default is dark text on white. Light is opposite.

  2. UIViewControllerBasedStatusBarAppearance – Set to NO if you have a global status bar styling

  3. UIStatusBarHidden – During launch, if you don’t want status bar to overlap your launch image, then set to YES.

Application Launch

In application:didFinishLaunchingWithOptions:, you could need 2 more codes to make status bar work.

1
2
3
4
5
// Set the status bar style
[application setStatusBarStyle:UIStatusBarStyleLightContent];

// And you need to un-hide it, if you hide it during launch
[application setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade];

Comments