6. 模態(tài)對(duì)話框(Modal Contexts)
Modality—that is, a mode in which something exists or is experienced—has advantages and disadvantages. It can give users a way to complete a task or get information without distractions, but it does so by temporarily preventing them from interacting with the rest of the app.
模態(tài)是一種事物存在的方式壁涎,它既有優(yōu)點(diǎn)也有缺點(diǎn)。它為用戶提供一種不受打擾地完成任務(wù)或獲取信息的方式蚌父,但同時(shí)它也臨時(shí)性地阻斷了用戶與 app 其他部分的交互诵姜。
Ideally, people can interact with iOS apps in nonlinear ways, so it’s best when you can minimize the number of modal experiences in your app. In general, consider creating a modal context only when:
(1)It’s critical to get the user’s attention
(2)A self-contained task must be completed—or explicitly abandoned—to avoid leaving the user’s data in an ambiguous state
理想情況下洒扎,人們可以用非線性的方式與 iOS app 交互,所以最好盡可能減少 app 中的模態(tài)交互體驗(yàn)。通常讥裤,只在如下情況下才使用模態(tài)對(duì)話框:
(1)一定要引起用戶注意的時(shí)候
(2)一個(gè)獨(dú)立的任務(wù)必須被完成或者明確放棄的時(shí)候蛔添,這是為了避免讓用戶數(shù)據(jù)處于模棱兩可的狀態(tài)
Keep modal tasks simple, short, and narrowly focused.?You don’t want your users to experience a modal view as a mini app within your app. If a subtask is too complex, people can lose sight of the main task they suspended when they entered the modal context. Be especially wary of creating a modal task that involves a hierarchy of views, because people can get lost and forget how to retrace their steps. If a modal task must contain subtasks in separate views, be sure to give users a single, clear path through the hierarchy, and avoid circularities. For guidelines on using modal views, see?Modal View.
確保模態(tài)任務(wù)簡(jiǎn)單痰催、簡(jiǎn)短兜辞、非常聚焦。不要讓用戶像使用 app 中的迷你 app 似的使用模態(tài)視圖陨囊。如果一個(gè)子任務(wù)過(guò)于復(fù)雜弦疮,人們會(huì)忘記進(jìn)入模態(tài)對(duì)話框前掛起的主任務(wù)。特別要當(dāng)心創(chuàng)建的模態(tài)任務(wù)中包含層次視圖的情況蜘醋,因?yàn)槿藗儠?huì)迷失胁塞、忘記如何返回之前的步驟。如果模態(tài)對(duì)話框必須包含不同視圖下的子任務(wù)压语,那一定要提供給用戶訪問(wèn)分層結(jié)構(gòu)的單一啸罢、清晰的路徑,不要有循環(huán)胎食。了解使用模態(tài)視圖扰才,參見(jiàn)?Modal View。
Always provide an obvious and safe way to exit a modal task.?People should always be able to predict the fate of their work when they dismiss a modal view.
If the task requires a hierarchy of modal views,?make sure your users understand what happens if they tap a Done button in a view that’s below the top level. Examine the task to decide whether a Done button in a lower-level view should complete only the part of the task in that view, or the entire task. Because of this potential for confusion, avoid adding a Done button to a subordinate view as much as possible.
總要提供明顯安全的方式來(lái)退出模態(tài)任務(wù)厕怜。人們應(yīng)該能夠預(yù)測(cè)退出模態(tài)視圖后的操作結(jié)果衩匣。
如果任務(wù)需要層次化的模態(tài)視圖,那要確保用戶在點(diǎn)擊頂級(jí)層次下面的視圖中的完成按鈕時(shí)粥航,能夠了解會(huì)發(fā)生什么琅捏。檢查一下任務(wù),來(lái)決定一個(gè)低層次的視圖中的完成按鈕是應(yīng)該完成當(dāng)前視圖下的部分任務(wù)递雀,還是整個(gè)任務(wù)柄延。由于這容易讓人困惑,所以盡可能避免在下級(jí)視圖中加入完成按鈕缀程。
Reserve alerts for delivering essential—and ideally actionable—information.?An alert interrupts the user’s experience and requires a tap to dismiss, so it’s important for users to feel that the alert’s message warrants the intrusion. To learn more, see?Alert.
Respect users’ preferences for receiving notifications.?In Settings, users indicate how they want to receive notifications from your app. Be sure to abide by these preferences so that users aren’t tempted to turn off all notifications from your app.
保留警告提示搜吧,用于傳達(dá)基礎(chǔ)的、理論上可操作的信息杨凑。警告提示會(huì)打斷用戶滤奈,還需要點(diǎn)擊才能退出,所以務(wù)必讓用戶感到警告提示是有理有據(jù)的撩满。了解更多蜒程,參見(jiàn)?Alert。
尊重用戶獲得通知的偏好鹦牛。在設(shè)置里搞糕,用戶表明了他們想如何從 app 中獲得通知。務(wù)必遵守他們的偏好曼追,這樣用戶才不至于傾向關(guān)閉 app 所有的通知窍仰。