angular - Ionic 2 中的页面过渡动画

标签 angular typescript animation ionic2 ionic3

我有一个简单的选项卡模板 Ionic 3 应用程序,其中,每当用户基于向左或向右滑动 View 时,我都会在选项卡之间切换点击标签或滑动屏幕。

我正在获取页面推送和弹出的动画

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

但不适用于选择标签

this.navCtrl.parent.select(2,{
    animation: true, direction: 'forward'
});

提前致谢

最佳答案

Ionic 目前无法做到这一点,但您可以使用 this amazing plugin实现这样的目标:

enter image description here

为了安装它,只需运行

npm i --save ionic2-super-tabs

然后在您应用的主模块中导入 SuperTabsModule.forRoot()

import { SuperTabsModule } from 'ionic2-super-tabs';

@NgModule({
    ...
    imports: [
      ...
      SuperTabsModule.forRoot()
      ],
    ...
})
export class AppModule {}

现在一切就绪,所以在你看来你可以做这样的事情:

<super-tabs>
  <super-tab [root]="page1" title="First page" icon="home"></super-tab>
  <super-tab [root]="page2" title="Second page" icon="pin"></super-tab>
  <super-tab [root]="page3" title="Third page" icon="heart"></super-tab>
</super-tabs>

关于angular - Ionic 2 中的页面过渡动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44234946/

相关文章:

Angular Firestore 如何检索子集合文档进行编辑?

javascript - Angular 7 调用 ngOnInit 方法或组件包含的任何其他组件方法

具有不同动画的Android ViewPager,例如放大,淡入淡出等

java - TranslateAnimation 后坐标错误

javascript - 通过递增和递减来动画数字

angular - 引用错误 : _rollupMoment__default is not defined

angular - 替换已弃用的 ViewContainerRef.parentinjector

typescript - 属性 'type' 在类型 'object' 上不存在,即使在 `"type"in` 检查之后

typescript - 如何使用强类型剩余参数输入构造函数选项对象参数

javascript - JS/TS 语法 : Destructuring assignment with inner assignment