Android 应用标题栏中的后退箭头?
Back arrow in title bar of Android app?
在我的手机 phone(Android 版本 5.1.1)上,当我进入“设置”然后选择“应用程序”时,我得到了我 [=40= 中安装的所有应用程序的列表].同时,标题栏从 "Settings" 变为“<- Apps”——也就是说,标题文本(原本位于左边缘)向右滑动,为 [= 腾出空间33=] 箭头,它将带我返回“设置”页面。这意味着 "back to the previous page" 功能现在位于两个位置 - 标题栏中的 left-pointing 箭头和始终位于屏幕底部的后退按钮。
这与 gmail/inbox 不同,后者的标题栏以汉堡菜单和标题文本 "Inbox"(或 "Primary")开头,如果我要求查看我的已发送项目,汉堡菜单保留,标题文本更改,返回原始屏幕的唯一方法是点击屏幕底部的后退按钮。
这与 tripadvisor 不同,它以图形标题栏开始,当您选择一个功能时,标题栏会更改为带有 left-arrow 后退按钮的文本。
这与联系人应用程序不同,后者的标题栏以 "Contacts" 开头,当您选择联系人时,整个屏幕都会显示所选联系人的信息(标题栏完全消失), return 到主屏幕的唯一途径是屏幕底部的后退按钮。
问题 1:我假设 Android 上的导航是一种 "whatever you feel like" 的情况是否正确?还是有一种 suggested/preferred 的导航方式,但很多应用程序开发人员都忽略了它?或者 suggested/preferred 导航方式是否因各种 Android 版本而改变?
问题 2:我正在启动一个全新的 Android 应用程序,使用我动态换入和换出的片段执行所有操作,是否有一种后退按钮样式可以与 "best"片段架构?
您讨论的是向上导航与向后导航。它们是两个独立的概念。来自 the docs here:
首先,UP导航:
The Up button is used to navigate within an app based on the
hierarchical relationships between screens. For instance, if screen A
displays a list of items, and selecting an item leads to screen B
(which presents that item in more detail), then screen B should offer
an Up button that returns to screen A.
后退导航:
The system Back button is used to navigate, in reverse chronological
order, through the history of screens the user has recently worked
with. It is generally based on the temporal relationships between
screens, rather than the app's hierarchy.
请务必注意,有时这两个按钮具有相同的功能,这会导致新开发人员产生混淆,认为向上按钮只是另一个返回按钮。同样,来自文档:
When the previously viewed screen is also the hierarchical parent of
the current screen, pressing the Back button has the same result as
pressing an Up button—this is a common occurrence. However, unlike the
Up button, which ensures the user remains within your app, the Back
button can return the user to the Home screen, or even to a different
app.
所以为了回答你的问题,使用 UP 导航,是的,任何事情都会在某种程度上发生。这取决于您希望如何设置应用程序的层次结构。但是这种类型的导航应该始终将您的用户留在您的应用程序中。但是 BACK 导航应该始终 return 到之前查看过的任何屏幕,即使它是主屏幕或其他应用程序。
您还可以see these docs获取有关如何正确设置 UP 导航的具体信息。
在我的手机 phone(Android 版本 5.1.1)上,当我进入“设置”然后选择“应用程序”时,我得到了我 [=40= 中安装的所有应用程序的列表].同时,标题栏从 "Settings" 变为“<- Apps”——也就是说,标题文本(原本位于左边缘)向右滑动,为 [= 腾出空间33=] 箭头,它将带我返回“设置”页面。这意味着 "back to the previous page" 功能现在位于两个位置 - 标题栏中的 left-pointing 箭头和始终位于屏幕底部的后退按钮。
这与 gmail/inbox 不同,后者的标题栏以汉堡菜单和标题文本 "Inbox"(或 "Primary")开头,如果我要求查看我的已发送项目,汉堡菜单保留,标题文本更改,返回原始屏幕的唯一方法是点击屏幕底部的后退按钮。
这与 tripadvisor 不同,它以图形标题栏开始,当您选择一个功能时,标题栏会更改为带有 left-arrow 后退按钮的文本。
这与联系人应用程序不同,后者的标题栏以 "Contacts" 开头,当您选择联系人时,整个屏幕都会显示所选联系人的信息(标题栏完全消失), return 到主屏幕的唯一途径是屏幕底部的后退按钮。
问题 1:我假设 Android 上的导航是一种 "whatever you feel like" 的情况是否正确?还是有一种 suggested/preferred 的导航方式,但很多应用程序开发人员都忽略了它?或者 suggested/preferred 导航方式是否因各种 Android 版本而改变?
问题 2:我正在启动一个全新的 Android 应用程序,使用我动态换入和换出的片段执行所有操作,是否有一种后退按钮样式可以与 "best"片段架构?
您讨论的是向上导航与向后导航。它们是两个独立的概念。来自 the docs here:
首先,UP导航:
The Up button is used to navigate within an app based on the hierarchical relationships between screens. For instance, if screen A displays a list of items, and selecting an item leads to screen B (which presents that item in more detail), then screen B should offer an Up button that returns to screen A.
后退导航:
The system Back button is used to navigate, in reverse chronological order, through the history of screens the user has recently worked with. It is generally based on the temporal relationships between screens, rather than the app's hierarchy.
请务必注意,有时这两个按钮具有相同的功能,这会导致新开发人员产生混淆,认为向上按钮只是另一个返回按钮。同样,来自文档:
When the previously viewed screen is also the hierarchical parent of the current screen, pressing the Back button has the same result as pressing an Up button—this is a common occurrence. However, unlike the Up button, which ensures the user remains within your app, the Back button can return the user to the Home screen, or even to a different app.
所以为了回答你的问题,使用 UP 导航,是的,任何事情都会在某种程度上发生。这取决于您希望如何设置应用程序的层次结构。但是这种类型的导航应该始终将您的用户留在您的应用程序中。但是 BACK 导航应该始终 return 到之前查看过的任何屏幕,即使它是主屏幕或其他应用程序。
您还可以see these docs获取有关如何正确设置 UP 导航的具体信息。