Oleksandr Veremchuk Oleksandr Veremchuk - 4 months ago 33
iOS Question

How to change Status Bar text color in iOS 7

My application has a dark background, but in iOS 7 the status bar became transparent. So I can't see anything there, only the green battery indicator in the corner. How can I change the status bar text color to white like it is on the home screen?

  1. Set the UIViewControllerBasedStatusBarAppearance to YES in the .plist file.

  2. In the viewDidLoad do a [self setNeedsStatusBarAppearanceUpdate];

  3. Add the following method:

    - (UIStatusBarStyle)preferredStatusBarStyle
        return UIStatusBarStyleLightContent; 

Note: This does not work for controllers inside UINavigationController, please see Tyson's comment below :)