replace


Description:

public void replace (NavigationPage[] pages)

Replaces the current navigation stack with pages.

The last page becomes the visible page.

Replacing the navigation stack has no animation.

If [method@NavigationView.add] hasn't been called for any pages that are no longer in the navigation stack, they are automatically removed.

pages.length can be 0, in that case no page will be visible after calling this method. This can be useful for removing all pages from this.

The [signal@NavigationView:AdwNavigationView:replaced] signal will be emitted.

See [method@NavigationView.replace_with_tags].

Parameters:

this

a navigation view

pages

the new navigation stack

n_pages

the number of pages in pages