ios 9 statusBar style
来源:互联网 发布:java web 线程池 编辑:程序博客网 时间:2024/06/05 10:07
-(UIStatusBarStyle)preferredStatusBarStyle;-(BOOL)prefersStatusBarHidden;
1、子类重写viewController以上两个方法,能够正常调用.
2、在navigtioncontroller 容器中的viewcontroller的上述方法不能够正常调用,系统根据navigtionController navigtaionbarstyle 确定statusbar 状态。
以下内容来自链接:
http://stackoverflow.com/questions/19022210/preferredstatusbarstyle-isnt-called/19513714#19513714
The UINavigationController does not forward on preferredStatusBarStyle
calls to its child view controllers. Instead it manages its own state
- as it should, it is drawing at the top of the screen where the status bar lives and so should be responsible for it. Therefor
implementing preferredStatusBarStyle in your VCs within a nav
controller will do nothing - they will never be called.The trick is what the UINavigationController uses to decide what to
return for UIStatusBarStyleDefault or UIStatusBarStyleLightContent. It
bases this on it’s UINavigationBar.barStyle. The default
(UIBarStyleDefault) results in the dark foreground
UIStatusBarStyleDefault status bar. And UIBarStyleBlack will give a
UIStatusBarStyleLightContent status bar.If you want UIStatusBarStyleLightContent on a UINavigationController
use: self.navigationController.navigationBar.barStyle =
UIBarStyleBlack;
3、需要navigation容器中viewcontroller以上方法调用,可以写两个navigtioncontroller 的类别,放入工程中,就会自己调用,(前提:plist文件中 View controller-based status bar appearance 需要设置为 YES)代码如下:
-(UIViewController *)childViewControllerForStatusBarStyle { return self.topViewController;}-(UIViewController *)childViewControllerForStatusBarHidden { return self.topViewController;}
- ios 9 statusBar style
- ios 9 隐藏 StatusBar
- IOS:StatusBar(状态栏)
- iOS状态栏 statusBar
- 隐藏IOS StatusBar
- ios开发---隐藏StatusBar
- IOS statusBar文字问题
- iOS statusBar 颜色问题
- iOS 7 statusBar适配
- iOS 隐藏statusbar
- iOS之statusBar状态栏
- iOS statusBar 状态栏定制
- iOS 隐藏statusbar
- iOS statusbar颜色
- iOS之StatusBar详解
- iOS之StatusBar
- iOS 隐藏statusbar
- 对ios中隐藏statusbar
- Linux 3D 编程学习总结
- SVN 将主干的代码合并到分支上
- 更改eclipse(myeclipse) author的默认名字(注释的作者)
- Dynamic Web Module 3.0 requires Java 1.6 or newer
- 20.Android读唯一的设备号IMEI
- ios 9 statusBar style
- 监听器,过滤器,拦截器(简单印象)
- Eclipse新建类的时候如何自动添加注释(作者,时间的信息
- 南工个人积分赛第四场——A - Solve equation【pow要用double型的】
- Qt自定义密码框,先显示后隐藏
- 指令<AngularJs>
- 图片上传,android ios Java服务器整合
- char可以存储汉字吗?| Java基础
- Android按退出键切换到后台不退出