I am making an app that requires the status bar to be hidden on one screen, but I then want it to come back on when the user goes back to the previous screen. I am using [[UIApplication sharedApplication] setStatusBarHidden:NO];
, which works, but when I turn it on, it overlaps the navigation bar and slows the app down to the point that it crashes. Is there anything else I can use, or am I just not using the code correctly?
Asked
Active
Viewed 270 times
0

cory ginsberg
- 2,907
- 6
- 25
- 37
1 Answers
0
I had what would seem to be a similar problem in moving from a DetailView to a FlipView - in which I wanted to have the status bar hidden to show a photo against a black background - and then back to the DetailView. The key thing seemed to be to have the code to revert the hiding in the viewWillDisappearAnimated method of the FlipView, rather than in its ViewDidUnload method or in a method in the DetailView controller. I suppose this resets everything before you return to your previous view. So my code in my FlipViewController was:
- (void)viewDidLoad
{
[[UIApplication sharedApplication] setStatusBarHidden:YES];
// other application-specific code
}
and
- (void)viewWillDisappear:(BOOL)animated
{
[[UIApplication sharedApplication] setStatusBarHidden:NO];
}
Hope this helps.

David
- 1,018
- 13
- 22