1

Alright I have my UIStatusBarStyle set to white with this

-(UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleLightContent;
}

and it's working BUT….. The status bar battery icon is green, how are we supposed to change that?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Chisx
  • 1,976
  • 4
  • 25
  • 53

2 Answers2

18

About the battery being green it's green only when charging the iDevice, when not charging the battery icon goes white or black according to the style of your statusbar.

Refael.S
  • 1,634
  • 1
  • 12
  • 22
1
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

or

If you prefer to opt out of having view controllers adjust the status bar style—and instead set the status bar style by using the UIApplicationstatusBarStyle method—add the UIViewControllerBasedStatusBarAppearance key to an app’s Info.plist file and give it the value NO.

Or

try this

  1. Set "View controller-based status bar appearance" (UIViewControllerBasedStatusBarAppearance) to YES in your Info.plist. (YES is the default, so you can also just leave this value out of your plist.)

  2. your class viewDidLoad method, call [self setNeedsStatusBarAppearanceUpdate].

  3. To Implement preferredStatusBarStyle, returning the status bar style that you want for this view controller.

-(UIStatusBarStyle) preferredStatusBarStyle { return UIStatusBarStyleLightContent; }

codercat
  • 22,873
  • 9
  • 61
  • 85