简体   繁体   中英

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

Is it recommended or discouraged? I've found two different guidelines from Google:

Guideline One: Back navigation is how users move backward through the history of screens they previously visited. All Android devices provide a Back button for this type of navigation, so your app should not add a Back button to the UI .

Guideline Two: 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.

So what's best practice? To include or not to include?

Yes, it is best to use it ! As per the material design docs , it says:

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. 

And the 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.

And of course, if you check almost all Google Apps, they include the Up navigation button in the toolbar.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM