Han Che
Han Che

Reputation: 8519

ionic 2 nav push - from right direction

How can I modify the the navPush in a way that new pages enter from the right instead of from the bottom? (there should be some parameters but I didn't find them inside the ionic docs

Thanks!

Upvotes: 6

Views: 5762

Answers (1)

sebaferreras
sebaferreras

Reputation: 44659

You can do that by setting the animate property. The only problem is that the push method only could be animated

  • from bottom to top: { animate: true, direction: 'forward' }
  • from top to bottom: { animate: true, direction: 'back' }

You can still use the setRoot() method like this to achieve the animation you're looking for:

this.navCtrl.setRoot(Page1, {}, { animate: true, direction: 'forward' });

Please find more information in this page.

Upvotes: 7

Related Questions