I have a UINavigationController
with a visible Navigation Bar.
I have one particular UIViewController
which I\'d like to hide the status bar when p
In your root view controller (where you want to show the status bar):
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES];;
}
In the view controller you push on the stack (where you want to hide the status bar):
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];;
}
Edit:
I realize now you want to hide the status bar. Got them mixed up since you were showing/hiding the nav bar in the code you posted. My mistake. It's essentially the same code, anyway:
In your root view controller (where you want to show the status bar):
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES];
}
In the view controller you push on the stack (where you want to hide the status bar):
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];
}
I just tested this with an existing project and it worked.