iOS9 隐藏状态栏方法

1.在Info.plist中增加 Status bar is initially hidden一行,选择为 YES,

2.还需增加 View controller-based status bar appearance 一行,选择为 NO。

这个方法支持iOS7及以后的系统,iOS9以后,通过[UIApplication sharedApplication] 取得app的单例,然后调用setStatusBarHidden方法隐藏 Status Bar的方法作废!

这个方法刚进去就隐藏状态栏了,可能出现页面上移的现象!(不想隐藏记得用代码设置)下面提供另一个方法:

1.在Info.plist中增加 View controller-based status bar appearance 一行,选择为 NO。

2.用[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO];的方法隐藏状态栏。

动画效果自己加,很好用!

你可能感兴趣的:(iOS9 隐藏状态栏方法)