0

Is there way to change the background color of status bar right now it show white with black icons of battery i want the color black here is the code i am using in viewDidLoad

     if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
    self.edgesForExtendedLayout = UIRectEdgeNone;
vzm
  • 2,440
  • 6
  • 28
  • 47
Aijaz Ali
  • 353
  • 2
  • 6
  • 17

3 Answers3

0
  1. Set UIViewControllerBasedStatusBarAppearance to NO. Call

  2. [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

For more details...check this link

EDIT: try adding this

self.extendedLayoutIncludesOpaqueBars = YES;
Community
  • 1
  • 1
Raon
  • 1,266
  • 3
  • 12
  • 25
0

in iOS 7 the status Bar is transparent. Make sure the background view is Dark if you are setting UIStatusBarStyleLightContent

For more info You can check the Apple UITransition Guide

Sahil Mahajan
  • 3,922
  • 2
  • 29
  • 43
0

1) set the UIViewControllerBasedStatusBarAppearance to YES in the plist

2) in viewDidLoad do a [self setNeedsStatusBarAppearanceUpdate];

3) add the following method:

-(UIStatusBarStyle)preferredStatusBarStyle
{ 
     return UIStatusBarStyleLightContent; 
} 

also check developers-guide-to-the-ios-7-status-bar

Deepesh
  • 8,065
  • 3
  • 28
  • 45
Pradhyuman sinh
  • 3,936
  • 1
  • 23
  • 38