iOS Status Bar 隐藏 显示
2016-09-14 本文已影响0人
GTMYang
- 首先覆盖方法
<pre>#pragma mark - override - (BOOL)prefersStatusBarHidden{
if (yourCondition) {
return YES;
}
return NO;
}</pre> - 触发更新Status Bar的方法
<pre>- (void)doStatusBarAppearanceUpdate {
[[UIApplication sharedApplication] setStatusBarHidden:[self prefersStatusBarHidden]];
if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
}
}</pre>