码迷,mamicode.com
首页 > 其他好文 > 详细

隐藏状态栏

时间:2014-11-13 22:16:27      阅读:120      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   io   color   ar   sp   div   on   

在info.plist 添加两个键

View controller-based status bar appearance   YES

Status bar is initially hidden  NO

 

代码中在要隐藏状态栏的地方(UIViewController 中)

@property (nonatomic, getter = isStatusBarHidden) BOOL statusBarHidden;

 

#pragma mark - 隐藏状态栏
#pragma mark - Private
-  (BOOL)prefersStatusBarHidden {
    return  self.statusBarHidden ;
}
- (void)toggleStatusBarHiddenWithAppearanceUpdate:(BOOL)updateAppearance
{
    self.statusBarHidden = updateAppearance;
    [UIView animateWithDuration:UINavigationControllerHideShowBarDuration animations:^{
            [self setNeedsStatusBarAppearanceUpdate];
        }];
    
}

 

 

[self  toggleStatusBarHiddenWithAppearanceUpdate:YES];

[self  toggleStatusBarHiddenWithAppearanceUpdate:NO];

 

 

隐藏状态栏

标签:des   style   blog   io   color   ar   sp   div   on   

原文地址:http://www.cnblogs.com/tangbinblog/p/4095796.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!