1

This has totally baffled me..

I've changed every color in every place to get the status bar background color to change but for some reason its stuck on the old color still.

Is there any code to force this to the color I need?

I've removed any color references and I'm now left with..

//Status Bar
    [application setStatusBarHidden:NO];
    [application setStatusBarStyle:UIStatusBarStyleLightContent];

https://i.stack.imgur.com/WC03d.png

rmaddy
  • 314,917
  • 42
  • 532
  • 579

2 Answers2

1

You could just create a UIView, set its background color to whatever color you want, set its frame to (0,0,view.bounds.size.width,20) (the status bar is 20 points high), and add it as a subview of your main view. I don't think the status bar has its own background color property as of iOS 7. You could do this in Interface Builder or in code.

This answer may also shed some light on your problem.

Community
  • 1
  • 1
trevorj
  • 2,029
  • 1
  • 16
  • 11
0

Add this method to your view controller

- (UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleLightContent;
}
rounak
  • 9,217
  • 3
  • 42
  • 59
  • This changes the color of the text but not the background.. Is there a simple code for the background color? – Robert Mellor Jul 08 '15 at 15:05
  • @RobertMellor the status bar itself is transparent. So whatever is behind it will show up. You can add a 20 pixel tall uiview, and set its color for the background. – rounak Jul 08 '15 at 15:17