2

I've uinavigationcontroller and within uiviewcontroller. Now my navigationbarhidden = yes. But when I hide the navigation bar then changed the color of the status bar. I want to change the color of the status bar as color of the hidden navigation bar. I did so :

enter image description here

I haven`t used navigation controller anywhere as shown in the picture. This is just hack way in iOS6, but it only changed color for views which are not in a navigation controller. For me though, solution is important only in iOS6

Any idea?

Community
  • 1
  • 1
Bob
  • 1,351
  • 11
  • 28

2 Answers2

0

Change StatusBar color

enter image description here

For Hide navigationBar

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    [self.navigationController setNavigationBarHidden:YES animated:YES];
}
iPatel
  • 46,010
  • 16
  • 115
  • 137
  • now, what if navigationBarHidden = NO. I had a problem with that: the color of satus bar hasn't changed!? – Bob Mar 27 '13 at 04:37
  • in someplace navigationBarHidden = NO, in someplace navigationBarHidden = YES. – Bob Mar 27 '13 at 04:41
0

As has been answered in this post:

In your "Project Summary", in "Status Bar", set "Style" and "Tinting" to "Default. Then, jump into you xib or storyboard and add a UINavigationBar just bellow the status bar. Set the UINavigationBar "Style" to "Default" and select the "Tinting" of your choice. Run! :-)

If you don't want any UINavigationBar visible in your Interface, all you want to do is putting the UINavigationBar behind all the Objects, or set the "Alpha" to zero.

Community
  • 1
  • 1
Nils Hott
  • 1,650
  • 15
  • 16
  • This isn't a solution. It's a hack that brings about the desired result at the cost of adding an unnecessary UI element, which is confusing to anyone who looks at the xib file, and also makes it difficult to work with other UI elements near the top of the screen. – Frank LaRosa Jul 30 '13 at 12:15