从iOS7开始,该系统提供2样的管理风格状态栏

由UIViewController管理(每UIViewController我们可以有各自不同的状态栏)

由UIApplication管理(由其统一管理的应用程序状态栏)

在iOS7在,默认情况下,,都是由UIViewController管理的。UIViewController实现下列方法就能够轻松管理状态栏的可见性和样式

状态栏的样式

- (UIStatusBarStyle)preferredStatusBarStyle; 



状态栏的可见性

- (BOOL)prefersStatusBarHidden;

假设想利用UIApplication来管理状态栏。首先得改动Info.plist的设置

UIApplication *app = [UIApplication sharedApplication];

[app setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];

[app setStatusBarStyle:UIStatusBarStyleLightContent animated:YES];

//    app.statusBarHidden = YES;

//    app.statusBarStyle = UIStatusBarStyleLightContent;

IOS status bar的更多相关文章

  1. iOS Status Bar变换

    http://www.cocoachina.com/ios/20160718/17020.html 背景 iOS 中经常会有需要在某个界面改变状态栏颜色或者某个界面隐藏状态栏的需求.而改变状态栏颜色和 ...

  2. iOS 使用Method Swizzling隐藏Status Bar

    在iOS 6中,隐藏Status Bar很的简单. // iOS 6及曾经,隐藏状态栏 [[UIApplication sharedApplication] setStatusBarHidden:YE ...

  3. iOS开发-UINavigationBar和Status Bar实用技巧

    iOS7之后关于UINavigationBar和Status  Bar都发生了一系列的改变,如果不需要兼容iOS7之后的设备,按照网上有些资料去解决问题会踩到一些坑.在iOS 7中,我们可以修改每个V ...

  4. Status bar and navigation bar appear over my view's bounds in iOS 7

    转自:http://stackoverflow.com/questions/17074365/status-bar-and-navigation-bar-appear-over-my-views-bo ...

  5. 转 如何在IOS设备中去掉屏幕上的status bar

    引入如何在IOS设备中去掉屏幕上的status bar,即:不显示设备上方的[网络.时间.电池??]条?操作方法一:在-info.list项目文件中,加上“Status bar is initiall ...

  6. iOS 7 改变Status Bar 颜色

    Set the UIViewControllerBasedStatusBarAppearance to NO in the Info.plist. In ViewDidLoad method or a ...

  7. Status bar - iOS之状态栏

    (一)设置状态栏显示和隐藏 1.通过 Info.plist 文件增加字段,控制状态栏全局显示和隐藏 在 Info.plist 文件中增加字段 Status bar is initially hidde ...

  8. Customizing Navigation Bar and Status Bar

    Like many of you, I have been very busy upgrading my apps to make them fit for iOS 7. The latest ver ...

  9. Status Bar in iOS7

    This is a very important change in iOS 7: the status bar is no longer a separate bar. It’s now somet ...

随机推荐

  1. Maven项目中mvn clean后找不到測试类问题

    在Maven项目中进行单元測试,但mvn clean后又一次mvn install项目,再次进行单元測试.会有下面的错误. <span style="font-family:KaiTi ...

  2. Ubuntu下成功安装QQ2013

    阳光小强最近用Win8系统感觉特别不爽,中午果断换了一个win7系统,又想着能不能搞个双系统(最近在看一些linux东西),于是就开始整起来.结果并不好,linux虽然整好了,但是硬盘全部格式化了,当 ...

  3. JavaScript对象的创建

    原文 简书原文:https://www.jianshu.com/p/6cb1e7b7e379 大纲 前言 1.简单方式创建对象的方法 2.工厂模式创建对象 3.构造函数模式创建对象 4.原型模式创建对 ...

  4. Write Code As If You Had to Support It for the Rest of Your Life

    Write Code As If You Had to Support It for the Rest of Your Life Yuriy Zubarev YOU COULD ASK 97 PEOP ...

  5. Android 节日短信送祝福(功能篇:2-短信历史记录Fragment的编写)

    因为用于展示短信记录的是一个ListView,但是为了方便,可以直接继承自ListFragment,就可以免去写ListView对应的布局了,只需要写其item对应的布局即可. item_sended ...

  6. jquery中的this与$(this)的区别总结(this:html元素)($(this):JQuery对象)

    jquery中的this与$(this)的区别总结(this:html元素)($(this):JQuery对象) 一.总结 1.this所指的是html 元素,有html的属性,可用 this.属性  ...

  7. Django日志器的使用

    Logging Mudel A quick logging primer Django uses Python’s builtin logging module to perform system l ...

  8. php字符串转时间戳

    PHP 提供了函数可以方便的将各种形式的日期转换为时间戳,该类函数主要是: strtotime():将任何英文文本的日期时间描述解析为时间戳. mktime():从日期取得时间戳. strtotime ...

  9. DWG 对象与ArcGIS 要素的强制对应关系

    转自原文DWG 对象与ArcGIS 要素的强制对应关系 DWG 对象与ArcGIS 要素的强制对应关系如下: Feature type DWG object types   Point Point, ...

  10. [Vue] Conditionally Render DOM Elements in Vue.js (v-if v-else v-show)

    You can use v-if and v-else to display content based on assertions on your data. Similarly, v-show c ...