iphone:The-status-bar

出自UXGuide.net

跳转到: 导航, 搜索

请帮助我们修订和更新本文的译文部分

本文的译文部分可能是由多个贡献者提供或从不同的渠道收集,未经过最终审阅和整理,请您帮助我们一起修订和更新本文的译文部分。

状态栏
The Status Bar

The status bar displays important information about the device and the current environment.

状态栏展示一些重要的信息,与现在的环境和设备相关。

The UIStatusBarStyle constant, described in UIApplication Class Reference, controls the status bar style. To specify the status bar style, you set a value in your Info.plist file. (For more information about the contents of this file, see “UIKit Keys”; to learn how to set values, see Property List Editor Help.)

外观和行为 Appearance and Behavior

The status bar always appears at the upper edge of the device screen (in all orientations) and contains information people need, such as the network connection, the time of day, and the battery charge.

状态栏总是出现在设备的屏幕的上边缘(不论设备方向),并且包含了用户需要的信息,比如网络连接、时间和电池电量等。

On iPhone, the status bar can have different colors; on iPad, the status bar is always black.

在iPhone上,状态栏可以有不同的颜色;在iPad上,状态栏始终是黑色的。

Figure 6-1  A status bar contains important information for users
图6-1 状态栏包含了对用户很重要的信息

ui_statusbar.jpg

规范 Guidelines

Although you don’t use the status bar in the same way that you use other UI elements, it’s important to understand its function in your app.

虽然使用状态栏的方式和你使用其他界面元素的方式不一样,但是理解它在你的程序中发挥的作用真的很重要。

Think twice before hiding the status bar if your application is not a game or full-screen media-viewing application. Although these apps might permanently hide the status bar, you should understand the ramifications of this design decision. Permanently hiding the status bar means that users must quit your app to find out, for example, whether they need to recharge their device.

如果你的应用程序不是游戏或全屏的媒体浏览程序,在隐藏状态栏之前请三思。虽然这些程序可能长期隐藏状态栏,但是你应该理解这是一种非主流的设计决定。永久隐藏状态栏意味着用户需要退出你的程序来看清楚,比如说,是否需要充电。

Note that most iPad applications do not need to hide the status bar to gain extra space, because the status bar occupies such a small fraction of the screen. On iPad, the subtle appearance of the status bar does not compete with your application for the user’s attention. The small size of the status bar, combined with the slightly rounded corners of the application’s upper bar, make the status bar seem like part of the device background.

注意,大多数iPad应用程序不需要隐藏状态栏来获取额外的空间。因为状态栏只占用那么一小块屏幕。在iPad上,外观低调的状态栏不会和你的应用程序争夺用户注意力。状态栏很小,结合程序的上边栏(上边栏倒有小圆角)来看,更像是设备的一部分。

Consider hiding the status bar (and all other app UI) while people are actively viewing full-screen media. If you do this, be sure to allow people to retrieve the status bar (and appropriate application UI) with a single tap. Unless you have a very compelling reason to do so, it’s best to avoid defining a custom gesture to redisplay the status bar because users are unlikely to discover such a gesture or remember it.

如果用户在欢乐的看图,看电影,或者看其他什么全屏的程序,可以隐藏掉不重要的状态栏等界面元素。但要注意,保证用户只需轻轻一点,就能把状态栏找回来。不要使用什么特殊的手势,用户不乐意记住这个手势。当然,如果你有令人信服的理由,那另当别论。

Don’t create a custom status bar. Users depend on the consistency of the system-provided status bar. Although you might hide the status bar in your app, it’s not appropriate to create custom UI that takes its place.

不要创建定制的状态栏。用户依赖于系统提供的状态栏的一致性。虽然你可以在你的程序中隐藏状态栏,但是创建一个全新的状态栏替换掉原来的还是不合适的。

When appropriate, display the network activity indicator. The network activity indicator can appear in the status bar to show users that lengthy network access is occurring. To learn how to implement this indicator in your code, see “Network Activity Indicator.”

如果合适,显示网络活动指示器。网络活动指示器可以出现在状态栏上,向用户表明漫长的网络访问正在发生。要知道如何在代码中实现这个指示器,见“Network Activity Indicator”

On iPhone, specify the color of the status bar. You can choose gray (the default color), opaque black, or translucent black (that is, black with an alpha value of 0.5).

在iPhone上,可以指定状态栏的颜色。你可以选择灰色(默认颜色),不透明的黑色或半透明的黑色(也就是α值为0.5的黑色)。

ui_statusbartypes.jpg

Be sure to choose a status bar appearance that coordinates with the rest of your iPhone application. For example, avoid using a translucent status bar if the navigation bar is opaque.

确保您选择的状态栏外观和您的iPhone应用程序的其他部分相配。比如,如果导航栏是半透明的黑色,就不要使用不透明黑色的状态栏。

On iPhone, set whether the change in status bar color should be animated. Note that the animation causes the old status bar to slide up until it disappears off the screen while the new status bar slides into place.

在iPhone上,设置是否应该采用动画方式显示状态栏颜色的改变。注意,动画效果使得旧状态栏向上滑出屏幕直到消失,同时新状态栏滑到相应位置。

个人工具
名字空间
变换
动作
导航
工具箱