目录

When NavPathStack clears the page stack or the back button is clicked, why is the navigation bar displayed, and what should I do to exit the page where Navigation is located?

Question

Why is the navigation bar displayed instead of exiting the page where Navigation is located when NavPathStack clears the page stack or the back button is clicked?

Solution

The hideNavBar attribute of the Navigation component is set to false by default. When the pop of the route stack is called, it returns to the NavBar. By default, since hideNavBar is set to false, calling pop() will cause the system to prioritize displaying the navigation bar inherent to the Navigation component rather than completely exiting the page stack.

You can hide the navigation bar or override the back button to not return to the navigation bar.