iphone:Usage-and-behavior
出自UXGuide.net
请帮助我们修订和更新本文的译文部分
本文的译文部分可能是由多个贡献者提供或从不同的渠道收集,未经过最终审阅和整理,请您帮助我们一起修订和更新本文的译文部分。
用法和行为
Usage and Behavior
Alerts, action sheets, and modal views are all modal, which means that users must explicitly dismiss them, by tapping a button, before they can continue to use the application. Although there are times when you need to warn users of potentially dangerous actions or provide extra choices, it’s important to avoid overusing these views. This is because:
警告、操作列表和模态视图都是视图,这就意味着用户必须明确的点击一个按键来消除他们,否则他们将不能继续使用程序。虽然有些时候你需要警告用户潜在的危险或者提供额外的选择,但是避免过度使用这些视窗是很重要的,因为:
- All types of modal views interrupt the user’s workflow.
- 所有模式视窗的类型都会中断用户的工作流程。
- The too-frequent appearance of a view requesting confirmation or acknowledgment is likely to be more annoying than helpful.
- 过于频繁的出现要求确认或承认的视窗会惹恼用户而不是帮助他们。
Alerts, in particular, should be used only rarely. When alerts appear too frequently, users are likely to dismiss them without reading them, just to get them out of the way.
警告要特别注意应该谨慎的使用。当警告过于频繁出现的时候,用户可能为了正常工作,不去看就将他们关闭了。
Alerts, action sheets, and modal views are designed to communicate different things:
警告、操作列表和模态视图是设计用来传递不同的东西的:
- Alerts give users important information that affects their use of the application (or the device). Alerts are usually unexpected, because they generally tell users about a problem or a change in the current situation that might require users to take action.
- 警告给予用户影响他们使用应用程序(或设备)的重要信息。警告通常是用户不希望出现的,因为通常它们会告诉用户出现了问题或者要求用户采取行动来改变当前的情况。
- Action sheets give users additional choices related to the action they are currently taking. Users learn to expect the appearance of an action sheet when they tap a toolbar button that begins either a potentially destructive action (such as deleting all recent calls) or an action that can be completed in different ways (such as a send action for which users can specify one of several destinations).
- 操作列表给了用户和他们当前正在进行的动作有关的额外的选项。当用户点击工具栏中的一个按钮来开始一个潜在的有破坏性的动作(想删除所有最近的通话记录)或完全可以通过别的方式完成的动作(像为那位用户发送的动作可以指定多个目标中的一个)时,他们会期望出现一个操作列表。
- Modal views provide more extensive functionality in the context of the current task. Modal views can also provide a way to perform a subtask directly related to the user’s workflow.
- 模态视图在当前任务的范围内提供了更广泛的功能。模态视图也可以提供一个执行跟用户工作流程直接相关的子任务的途径。
These types of views also differ in appearance and behavior, which underscores the difference in the messages they send. Because users are accustomed to the appearance and behavior of these views, it’s important to use them consistently and correctly in your application. Read the following sections to learn more about using alerts, action sheets, and modal views.
这些类型的视图在外表和行为上也是不同的,其中强调了他们发送信息的差异。因为用户习惯了这些视窗的外表和行为,所以在你的应用程序中利用用户的一致性和正确性很重要。接下来的章节将介绍更多关于警告、操作列表和模态视图的用法。
警告的用法 Using Alerts
An alert pops up in the middle of the application screen and floats above its views to give users critical information in a highly visible way. The unattached appearance of an alert emphasizes the fact that its arrival is due to some change in the application or the device, not necessarily as the result of the user’s most recent action. An alert should display text that explains the situation and, ideally, give users a way to choose an appropriate course of action.
警告窗口在应用程序页面的中间位置弹出并浮动,它用一种高度明显的方式给用户危险的信息。警告中未附加的外表强调了现在需要确认一些程序或设备上的改动的事实,不一定是用户最近的操作。警告弹窗应该显示解释有关情况的位子,最好是能为用户提供一个适当操作的选择方法。
Users are accustomed to seeing alerts from the device or from built-in applications that run in the background, such as Messages, but you should seldom need to use them in your application. For example, you might use an alert to tell users that the task they initiated is blocked. It makes sense to display an alert with this message, because it’s important to tell users what the problem is and give them a choice of ways to handle it.
用户已经习惯看到设备或者后台运行的内部程序发出的警告,像消息一类的,不过你应该很少需要在你的应用程序中用到他们。例如,你可能需要警告窗口来告诉用户他们开始执行的任务被阻止了。用消息的形式来显示一个警告时符合逻辑的,因为告诉用户问题是什么病给他们处理它的方法是非常重要的。
You can also use an alert to give users a chance to accept or reject an outcome that is potentially dangerous. When this is the case, the alert should display two buttons: one that dismisses the alert and performs the action and one that dismisses the alert without performing the action. Often, it makes sense to use the label "Cancel" for the button that dismisses the alert without performing the action. Note that if users press the Home button while such an alert is visible, the result, in addition to quitting the application, should be identical to tapping the Cancel button: That is, the alert is dismissed and the action is not performed.
你也可以使用警告来给用户一个接受或拒绝有潜在危险结果的机会。在这种情况下,警告窗口应该有两个按键:一个是关闭警告窗口并继续操作,一个事关闭警告窗口并停止操作。通常使用标签为“取消”的按键关闭窗口并停止操作,这样比较符合逻辑。请注意当窗口弹出的时候用户按下“Home”键的结果就是关闭应用程序,这和点击“取消”按钮的结果是一样的:那就是警告窗口会关闭并停止执行操作。
The infrequency with which alerts appear helps users take them seriously. Be sure to minimize the number of alerts your application displays and ensure that each one offers critical information and useful choices. In general, try to avoid creating alerts that:
使用警告帮助用户认真考虑的次数并不多。一定要尽可能的在你的应用程序中减少警告的数量并确保每个警告都给用户提供了重要的信息或有用的选择。一般来说,在下列情况下避免警告:
- Update users on tasks that are progressing normally.
- 用户正在进行任务的时候正常的更新
- Instead, consider using a progress view or an activity indicator to provide progress-related feedback to users (these controls are described in “Progress Views” and “Activity Indicators”).
- 相反,考虑使用一个progress view或者一个activity indicator来为用户提供进度相关的反馈(关于这些控件的描述请参阅107页的“Progress Views”和“Activity Indicator”
- Ask for confirmation of user-initiated actions.
- 询问并确认用户开始的操作
- To get confirmation for an action the user initiated, even a potentially risky action such as deleting a contact, you should use an action sheet (described next in “Using Action Sheets”).
- 想确定一个用户已经开始的操作,甚至一个潜在的危险操作如删除联系人,你应该使用操作列表(在接下来的“操作列表的用法”会有详细描述)。
- Inform users of errors or problems about which they can do nothing.
- 告知用户他们没办法解决的错误或问题
- Although it might be necessary to use an alert to tell users about a critical problem they can’t fix, it’s better to integrate such information into the user interface, if possible. For example, instead of telling users every time a server connection fails, display the time of the last successful connection.
- 虽然有时候可能必须要用一个警告窗口来告诉用户他们遭遇了不可修复的问题,但是如果可能的话尽量将这些信息整合到用户界面当中。例如,显示最后一次成功连接服务器的时间,而不是在每次连接失败的时候都告诉用户连接失败。
使用操作列表 Using Action Sheets
An action sheet displays a collection of alternatives that are associated with a task users initiate by tapping a button in an application’s toolbar. An action sheet is an appropriate way to:
操作列表显示的是与一个用户点击应用程序工具栏按键开始的任务相关的选项的集合。操作列表适用于以下情况:
- Provide a selection of ways the task can be completed. In Photos, for example, users can tap the Send button when viewing an individual photo. An action sheet appears, giving users a choice of three destinations for the photo (in addition to a Cancel button, which cancels the send).
- 提供可以完成任务不同方式的选择。例如,在图片中,当用户浏览一个特别的图片时可以点击发送按键,然后会出现一个操作列表,给用户三个发送图片目的地的选项(不包括取消发送的“取消”按钮)。
- It’s useful to display an action sheet in a situation like this, because it allows you to provide a range of choices that make sense in the context of the current task, without giving these choices a permanent place in the user interface.
- 在这种情况下弹出一个操作列表是非常有用的,因为它允许你提供一些列选项,这样会使当前任务的运行环境更加合理,而且不需要在用户界面上给这些选项一个永久的空间。
- Get confirmation before completing a potentially dangerous task. For example, depending on Mail settings, an action sheet appears when users tap the Trash button in the Mail toolbar, allowing them to proceed with the deletion or cancel it.
- 在完成一个具有潜在危险的任务之前得到确认。例如,在邮件的设置中,当用户点击邮件工具栏上的“Trush”按键时一个操作列表会出现,让他们进行删除或取消。
- When you display an action sheet in a situation like this you ensure that users understand the dangerous effects of the step they’re about to take and you can provide some alternatives. This type of communication is particularly important on iPhone OS–based devices because sometimes users tap controls without meaning to.
- 当你在这种情况下显示你的操作列表时你要确保用户知道他们要进行的这个步骤可能会造成危险的影响并且你可以提供一些其他选项。在iPhone操作设备中这种沟通时尤为重要的,因为有时候用户会没理由的点击一些控件。
An action sheet always emerges from the bottom of the application screen and hovers over its views (as shown in the far left of Figure 7-1). Unlike an alert, however, the side edges of an action sheet are anchored to the sides of the screen, reinforcing its connection to the application and the user’s most recent action.
操作列表总是从应用程序的页面底部弹出的并且覆盖住当前页面(如图7-1的左图所示)。然而不像警告窗口那样,操作列表的两端是固定在屏幕的边缘的,加强了它与应用程序以及用户最近的操作之间的联系。
An action sheet contains a few buttons that allow users to choose how to complete their task. You should not have to add a message to an action sheet because the button labels, in conjunction with the task being performed, should provide enough context for the user to understand their choices. When users tap a button, the action sheet disappears. Because an action sheet should provide users with a choice of actions, an action sheet always provides more than one button.
一个操作列表有几个按键并允许用户选择怎样完成他们的任务。你不应该在操作列表上加入信息,因为跟当前正在执行任务有关的按键标签应该可以提供足够的信息来帮助用户理解他们的选择。当用户点击一个按键的时候,操作列表会消失。因为操作列表应给提供给用户一些操作上的选择,所以一个操作列表总是提供不止一个按键。
使用模态视图 Using Modal Views
By default, a modal view slides up from the bottom edge of the screen and always covers the entire application screen (as shown in the middle of Figure 7-1). Because a modal view hides the current application screen, it strengthens the user’s perception of entering a different, transient mode in which they can accomplish something.
默认情况下,一个模型视窗从屏幕的底部边缘滑出,通常会覆盖应用程序的整个页面(如79页的图7-1中图所示)。因为模型视窗将当前应用程序的页面隐藏起来,这种做法会加深用户的一种认知,就是他们进入到了一个短暂,不同的模式中,在这个模式中他们可以有所作为。
A modal view can display text if appropriate, and contains the controls necessary to perform the task. In addition, a modal view generally displays a button that completes the task and dismisses the view, and a Cancel button users can tap to abandon the task.
一个模型视窗在适当的情况下可以显示文本,并包含必要的控件来执行任务。此外,模型视窗通常会显示一个按键来完成任务并关闭窗口,还会显示一个用户可以点击的“取消”按键来放弃任务。
A modal view supports more extensive user interaction than an action sheet. Unlike an action sheet, which accepts a single choice, a modal view supports multistep user interaction, such as the selection of more than one option or the inputting of information.
模型视窗比操作列表支持更为广泛的用户交互。与操作列表只显示一个单一选项不同,模型视窗支持多步骤的交互,像多个选项或信息输入的选择。
Use a modal view when you need to offer the ability to accomplish a self-contained task related to your application’s primary function. A modal view is especially appropriate for a multistep subtask that requires user interface elements that don’t belong in the main application user interface all the time. A good example of a modal view is the compose view in Mail. When users tap the Compose button, a modal view appears that contains text areas for the addresses and message, a keyboard for input, a Cancel, and a Send button.
当你需要提供一个完成与应用程序的主要功能相关的整套任务的能力时,那么请使用模型视窗。模型视窗特别适合多步骤的用户界面元素不属于应用程序主界面的子任务。邮件程序中写信模式是有关模型视窗的一个优秀例子。当用户点击“写邮件”按键的时候,会出现一个包含地址和信息的文本区域,输入的键盘,“取消”“发送”按键的模型视窗。