状态栏statusBar的一些设置
2016-11-23 本文已影响0人
怪兽密保
参考文章https://my.oschina.net/shede333/blog/304560
设置状态栏的前景颜色
1.首先需要在plist里设置View controller-based status bar appearance为NO
![](https://img.haomeiwen.com/i2990631/f579f0e2f8467d8e.png)
2.在控制器的viewDidAppear设置代码
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
设置状态栏隐藏
[UIApplication sharedApplication].statusBarHidden=YES;
设置状态栏启动页时或加载广告是没有状态栏,首页时显示状态栏
1首先在plist设置状态栏隐藏
![](https://img.haomeiwen.com/i2990631/65940af2c2527b83.png)
2.在首页viewDidAppear设置代码
[UIApplication sharedApplication].statusBarHidden=NO;