1

I'm trying to make a simple app with Playground (https://play.nativescript.org/). I'm using "RadSideDrawer" as a side menu. I'm satisfied. BUT ... every time I use "RadSideDrawer" and I move from one page to another, inside the "ActionBar" a button appears whose function is to bring back to the left page (please have a look at this page https://www.attivitacollaterali.it/appdata/services/apps/RadSideDrawer.html). I don't need and want this button. How can I make it not appear? Thank you. Or, if not, at least update "RadSideDrawer". I mean that if the button goes back, for example to the "Search" page from the "Home" page, it should highlight/select "Search" in the "RadSideDrawer" menu and not leave "Home". Thanks again.

lapo
  • 13
  • 2

1 Answers1

1

I think you're looking for the "clearHistory" option while navigating. When navigating to another page, you must do this:

this.router.navigate([url], { clearHistory: true });

Just make sure you're injecting RouterExtensions in your constructor:

constructor(private router: RouterExtensions) {}

That should clear the navigation stack when navigating, thus removing the button to go back to the previous page.

EDIT: If you want to retain the navigation stack, I believe you can also edit your action bar like this:

<ActionBar>
    <NavigationButton visibility="collapsed"/>
</ActionBar>
  • Now it works the way I wanted it to. Just add "clearHistory: true" to the code snippet that allows you to navigate from one page to another, which in my case becomes: Frame.topmost().navigate({ moduleName: componentRoute, transition: { name: "fade" }, clearHistory: true }); Thanks again! I'm sorry, but I still can't figure out where to say this is solved. – lapo Mar 03 '20 at 08:38
  • To the left side of the answer there should be a checkbox underneath the up and down vote arrows. Clicking the checkbox marks the answer as solved. Glad I could help! – Michael Joseph Mar 03 '20 at 13:39