Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 665
Han Che Avatar asked Aug 28 '16 17:08

Han Che


1 Answers

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.

like image 55
sebaferreras Avatar answered Oct 14 '22 06:10

sebaferreras