Last active
January 1, 2016 11:49
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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