目录

How do I set a default page in the Navigation component?

Symptom

When the device is initially in landscape mode, Navigation is displayed in split-column mode. Since no pages are in the navigation stack, the right pane displays no content. How do I add a default page for the right pane?

Solution

You can use the onNavigationModeChange method to listen to the mode of Navigation and manually control whether to load the default page:

Since API version 20, you can set the splitPlaceholder attribute of the Navigation component to set the default placeholder page.