Since iOS 7 rolled out, I can\'t show or hide status bar with animation just like in iOS 6. For now I use NSTimer to control it when to hide.
here is my code:
You need to call
[UIViewController setNeedsStatusBarAppearanceUpdate];
from within an animation block as in the following example:
@implementation SomeViewController {
BOOL _statusBarHidden;
}
- (BOOL)prefersStatusBarHidden {
return _statusBarHidden;
}
- (void)showStatusBar:(BOOL)show {
[UIView animateWithDuration:0.3 animations:^{
_statusBarHidden = !show;
[self setNeedsStatusBarAppearanceUpdate];
}];
}
@end