Revealed 3 options for solving this problem.
Option 1: resize the navigation bar
float currentVersion = 7.0; if ([[[UIDevice currentDevice] systemVersion] floatValue] >= currentVersion) { // iOS 7 self.navBar.frame = CGRectMake(self.navBar.frame.origin.x, self.navBar.frame.origin.y, self.navBar.frame.size.width, 64); }
Option 2: Hide the status bar
For example, in a modal view in which you want to hide the status bar
Add this method
- (BOOL)prefersStatusBarHidden { return YES; }
In viewDidLoad add
float currentVersion = 7.0; if ([[[UIDevice currentDevice] systemVersion] floatValue] >= currentVersion) { [self prefersStatusBarHidden]; [self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)]; } else { [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide]; }
Now that you reject the modal view and you want your status bar to be back. Add this to viewWillAppear
float currentVersion = 7.0; if ([[[UIDevice currentDevice] systemVersion] floatValue] >= currentVersion) { [self prefersStatusBarHidden]; [self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)]; NSLog(@"ios7"); } else { [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationSlide]; }
and this but return NO this time
- (BOOL)prefersStatusBarHidden { return NO; }
Option 3: Insert into Nav Controller
Select your modal view, just insert it into the navigation controller.

DogCoffee Sep 12 '13 at 0:58 2013-09-12 00:58
source share