Ionic default push/pop transitions

被刻印的时光 ゝ 提交于 2019-12-13 01:04:55

问题


I'm new with Ionic, and i'm learning using the docs.

Saw that i can push a page in the template, like this:

<button ion-button [navPush]="pushPage"></button>

link: https://ionicframework.com/docs/api/components/nav/NavPush/

But i can't find a way to change the transition to left-to-right (like IOS transitions).

How can i change the default transition?

Thanks


回答1:


Update:

You can use Native Page Transitions plugin.You need to configure it globally.Then you'll have that transition page animations when you'll use navPush on each and every page.

Old:

You need to do it like this:

this.navCtrl.push(pushPage, {
    animation: true, direction: 'forward'
});

Some methods on NavController allow for customizing the current transition. To do this, we can pass an object with the modified properites.

You can read more about it here.



来源:https://stackoverflow.com/questions/45827903/ionic-default-push-pop-transitions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!