21

I'm developing an application for a school that I work at. Currently I am having issues with changing the status bar text from it's default state of black to white so we can actually read it!

I have tried everything i've found here and on the dev forums, including calling View controller-based status bar appearance = "NO" and also [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

enter image description here

Arslan Ali
  • 17,418
  • 8
  • 58
  • 76
Damian W
  • 568
  • 2
  • 4
  • 14

3 Answers3

75

I just fixed this issue in one of my apps. Implement this in your UIViewController:

- (UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleLightContent;
}

Or choose another UIStatusBarStyle value that you need.

bneely
  • 9,083
  • 4
  • 38
  • 46
  • 2
    Only answer that worked. None of the others seemed to affect the status bar. – olivaresF Feb 05 '14 at 15:01
  • 1
    An outstanding fix. What's more, if you're using navigation controllers within your app via Storyboards that don't necessarily need specific coding to handle what they do, you can use this in a single UINavigationController class that's assigned to each navigation view within the Storyboard. – Terrance Shaw Mar 24 '14 at 21:48
  • 4
    this method is not called in my project. – bhavik Sep 23 '14 at 14:34
15

You can use this in your AppDelegate:

[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
amb
  • 4,798
  • 6
  • 41
  • 68
0

Here is a solution for your problem: How to change Status Bar text color in iOS 7.

Community
  • 1
  • 1
kenmar
  • 21