Skip to content

Instantly share code, notes, and snippets.

@jeffbailey
Last active January 1, 2016 11:49
Show Gist options
  • Save jeffbailey/8140811 to your computer and use it in GitHub Desktop.
Save jeffbailey/8140811 to your computer and use it in GitHub Desktop.
iOS 7 override the status bar style for a UIViewController. You can also call the setNeedsStatusBarAppearanceUpdate method on the view controller to force the methods to be called again.
@implementation MyViewController
- (UIStatusBarStyle)preferredStatusBarStyle {
return UIStatusBarStyleDefault;
}
- (BOOL) prefersStatusBarHidden {
return NO;
}
- (IBAction) hidStatusBar {
[UIView animateWithDuration:0.5 animations:^{
[self setNeedsStatusBarAppearanceUpdate];
}];
}
- (UIStatusBarAnimation)preferredStatusBarUpdateAnimation {
return UIStatusBarAnimationSlide;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment