标签:statusbar 状态栏 隐藏 ios setstatusbarhidden
Storyboard
界面上选中UIViewController,最右边Simulated Metrics找到 Status Bar 设定成 None
ViewController
iOS 6通过[UIApplication sharedApplication] 取得app的单例,然后调用setStatusBarHidden方法隐藏 Status Bar。
iOS 7
Info.plist
不但要在Info.plist中增加 Status bar is initially hidden一行,选择为 YES,
还需增加 View controller-based status bar appearance 一行,选择为 NO。
如果想设置为现实则将hidden设置为no- (void)viewDidLoad {
[super viewDidLoad];
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
// Do any additional setup after loading the view.
}
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationSlide];
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:statusbar 状态栏 隐藏 ios setstatusbarhidden
原文地址:http://blog.csdn.net/lu_ca/article/details/47085181