iPhone Development 101: User Interface: The Status Bar

本文详细介绍了iOS应用中UIStatusBar的样式设置方法,包括默认样式、黑色透明样式和黑色不透明样式的使用场景,并探讨了如何在Info.plist文件或代码中进行设置。此外,文章还讨论了完全隐藏状态栏的考虑因素及实现方法。

http://www.idev101.com/code/User_Interface/UIStatusBar.html


The Status Bar (or UIStatusBar) is the 20-pixel-high strip at the top of the window that shows the carrier name and signal strength, network status, current time, and battery strength:

Default
Black Opaque
Black Translucent

The status bar can be gradient gray (with black text), black opaque (with white text), or black translucent. By default the status bar is gray. If your app features standard iPhone UI elements, then stick with the default status bar. However if your app has custom views with dark backgrounds, then a black status bar will look better.

Black and white status bars push the underlying views down, giving you 320 x 460 pixels of screen space to work with in your app. A translucent status bar overlays the underlying view, giving you the full 320 x 480 pixels of screen space. (More on sizes)

You can set the status bar style either programmatically or in your Info.plist file. If you change it in Info.plist, then the style is changed when the app launches (while the app is loading). If you change it programmatically, then the style changes after the app finishes loading.

To change the status bar style in Info.plist, look for your Appname-Info.plist file in the Resources group of your Xcode project. To add a new element to this file, click on the last line of options so that the + symbol appears on the right. Click it, then enter UIStatusBarStyle in the left column. After you set that, the right column will then change to a list of options:

To change the style programmatically after the app has launched, add this line to your app delegate's applicationDidFinishLaunching method:

 [[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleBlackTranslucent];

Valid status bar styles are UIStatusBarStyleDefault, UIStatusBarStyleBlackTranslucent, and UIStatusBarStyleBlackOpaque.

Hiding the Status Bar

You can also hide the status bar completely, but give some consideration as to whether you should do this. From theiPhone Human Interface Guidelines: "People expect to be able to see the current battery charge of their devices; hiding this information, and requiring users to quit your application to get it, is not an ideal user experience."

To hide the status bar when the app launches, add a new line to Info.plist and enter UIStatusBarHidden in the left column. The right column will change to a checkbox:

To hide the status bar after the app has completely launched, change it programmatically by adding this line to your app delegate's applicationDidFinishLaunching method:

[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];

If you set animated to YES then the status bar will disappear by fading out.


标题基于Python的自主学习系统后端设计与实现AI更换标题第1章引言介绍自主学习系统的研究背景、意义、现状以及本文的研究方法和创新点。1.1研究背景与意义阐述自主学习系统在教育技术领域的重要性和应用价值。1.2国内外研究现状分析国内外在自主学习系统后端技术方面的研究进展。1.3研究方法与创新点概述本文采用Python技术栈的设计方法和系统创新点。第2章相关理论与技术总结自主学习系统后端开发的相关理论和技术基础。2.1自主学习系统理论阐述自主学习系统的定义、特征和理论基础。2.2Python后端技术栈介绍DjangoFlask等Python后端框架及其适用场景。2.3数据库技术讨论关系型和非关系型数据库在系统中的应用方案。第3章系统设计与实现详细介绍自主学习系统后端的设计方案和实现过程。3.1系统架构设计提出基于微服务的系统架构设计方案。3.2核心模块设计详细说明用户管理、学习资源管理、进度跟踪等核心模块设计。3.3关键技术实现阐述个性化推荐算法、学习行为分析等关键技术的实现。第4章系统测试与评估对系统进行功能测试和性能评估。4.1测试环境与方法介绍测试环境配置和采用的测试方法。4.2功能测试结果展示各功能模块的测试结果和问题修复情况。4.3性能评估分析分析系统在高并发等场景下的性能表现。第5章结论与展望总结研究成果并提出未来改进方向。5.1研究结论概括系统设计的主要成果和技术创新。5.2未来展望指出系统局限性并提出后续优化方向。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值