zoukankan      html  css  js  c++  java
  • iOS7 中的statusbar的隐藏和样式更改

    ios7以前,如果想要隐藏statusbar,需要用到[UIApplicationsharedApplication].statusBarHidden = YES; 或者在plist文件中设定Status bar的相关属性。如果一个程序有多个viewcontroller,有些需要statusbar,有些不需要,那么就要在每个view controller中都进行[UIApplicationsharedApplication].statusBarHidden的设定,感觉不太友好。

    ios7把statusbar的显示和样式设定都交给了view controller,在view controller中多了几个方法,- (BOOL)prefersStatusBarHidden,- (UIStatusBarStyle)preferredStatusBarStyle,等等,通过这几个方法,就可以为每个view ctroller定制不同的statusbar 显示和样式。虽然这些改动从最终的效果来看与之前的版本没什么不同,但是从理念上说,statusbar的显示和样式的确应该交给view controller去做。

    当然,如果你的程序仅仅需要把statusbar在ios7上给隐藏起来,就不必用以上的方法了,你可以到plist中,设定View controller-based status bar appearance 属性为NO,之后就可以使用ios7以前的设定方法了。 

     

  • 相关阅读:
    Docker学习总结(一)--Docker简介
    Liunx软件安装之Zabbix监控软件
    Liunx软件安装之Nginx
    Liunx软件安装之Redis
    Liunx软件安装之Tomcat
    Liunx软件安装之JDK
    Liunx软件安装之MySQL
    Liunx学习总结(九)--防火墙
    tensorflow 错误
    anaconda安装失败
  • 原文地址:https://www.cnblogs.com/breezemist/p/3524032.html
Copyright © 2011-2022 走看看