0

How to change the background color of status bar in ios7 while having different color of navigation bar? I know in ios7 status bar color take color value from navigation bar.

Tanvi Jain
  • 917
  • 2
  • 7
  • 19
  • possible duplicate of [How to change the status bar background color and text color on iOS 7?](http://stackoverflow.com/questions/19063365/how-to-change-the-status-bar-background-color-and-text-color-on-ios-7) – The dude Sep 03 '14 at 11:59

2 Answers2

0

Change the tint colour and barTint colour of navigation bar changes colour of status bar for predefined values if you want custom Colours add subview to navigation bar in viewDidLoad

self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:200.0f/255.0f green:126/255.0f blue:200.0f/255.0f alpha:1.0f];
Ganesh Kumar
  • 708
  • 6
  • 25
0

add subview to navigation bar with desired color as background colour like this:

UIView *view=[[UIView alloc] initWithFrame:CGRectMake(0, 0,320, 20)];

view.backgroundColor=[UIColor blueColor];
[self.navigationController.navigationBar addSubview:view];

It works for me to change colour of status bar.

chaithraVeeresh
  • 258
  • 3
  • 11