iPhone Development 101: User Interface: The Status Bar
来源:互联网 发布:spark sql使用 编辑:程序博客网 时间:2024/05/21 09:13
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:
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.
- iPhone Development 101: User Interface: The Status Bar
- 《iOS Human Interface Guidelines》——The Status Bar
- Agile User Interface Development
- IOS7 The Status Bar
- Hiding the Status Bar
- Get iPhone Status Bar Height
- Android navigation bar and the status bar
- iphone隐藏,渐显Status Bar的方法
- Multilingual User Interface (MUI) OS Design Development
- S 7 - Status bar overlaps the view
- The Yahoo! User Interface Library
- Status bar
- 管理系统UI之二:隐藏Status Bar (Hiding the Status Bar)
- 管理系统UI之二:隐藏Status Bar (Hiding the Status Bar)
- 管理系统UI之二:隐藏Status Bar (Hiding the Status Bar)
- 管理系统UI之二:隐藏Status Bar (Hiding the Status Bar)
- Hiding the iPhone Tab Bar With TTNavigator
- Testing the User Interface - Using DotNetMock
- 应用生命周期
- POJ1106(简单几何--极角排序)
- 【7gyy】笔者支招:快速删除本本BIOS的密码
- opencv moravec角点检测
- 【HDIJ】1266 -> Reverse Number
- iPhone Development 101: User Interface: The Status Bar
- startService与bindService的区别
- cocos2d 中添加显示文字的三种方式(CCLabelTTF 、CCLabelBMFont 和CCLabelAtlas)
- 数据库异常 其他会话正在使用事务上下文
- jquery+swfupload+servlet 多文件上传
- SQLite 入门教程(一)基本控制台(终端)命令
- extern 关键字 声明和定义的区别
- jsp使用<c:choose>标签来控制内容显示
- 大整数模板