用法:将 up/back 按钮添加到 Android 工具栏

Usage: adding an up/back button to an Android toolbar

推荐还是不推荐?我从 Google:

中找到了两个不同的指南

准则一: 后退导航是用户通过他们之前访问过的屏幕的历史记录向后移动的方式。所有 Android 设备都为此类导航提供后退按钮,因此您的应用不应向 UI.

添加后退按钮

准则二: 向上按钮用于根据屏幕之间的层次关系在应用程序内导航。例如,如果屏幕 A 显示项目列表,并且选择一个项目会导致屏幕 B(更详细地显示该项目),然后屏幕 B 应该提供一个向上按钮 returns屏幕 A.

那么最佳做法是什么?包括还是不包括?

是的,最好用它! As per the material design docs,它说:

The nav icon at the left side of the app bar can be:

A control to open a navigation drawer.
An up arrow for navigating upward through your app’s hierarchy.
Omitted entirely if no navigation is required from this screen.

navigation in history docs:

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.

当然,如果您检查几乎所有 Google 应用程序,它们都会在工具栏中包含向上导航按钮。