How to disable/change animation between views in i

2019-04-05 18:32发布

问题:

I started an Ionic tabs project. With this project comes the default animation between views (which is from left to right when entering, and from right to left when going back). I would like to retain control on this - by specifying two type of view animations:

  • from bottom to up
  • no animation

So far I tried to disable the animation as follows, as was suggested on this Ionic Forum Topic but it did not change anything:

<ion-nav-view animation="no-animation"></ion-nav-view>

What is going on?

回答1:

angular.module('YOUR_APP_NAME_HERE').config(function($ionicConfigProvider) {
  $ionicConfigProvider.views.transition('none');
});

http://ionicframework.com/docs/api/provider/$ionicConfigProvider#views.transition



回答2:

Another way.

The transition type which the nav view transition should use when it animates. Current, options are ios, android, and none.

Home

http://ionicframework.com/docs/api/directive/navTransition/