我有一个简单的选项卡模板 Ionic 3 应用程序,其中,每当用户基于向左或向右滑动 View 时,我都会在选项卡之间切换点击标签或滑动屏幕。
我正在获取页面推送和弹出的动画
this.navCtrl.push(ContactPage, {
animation: true, direction: 'forward'
});
但不适用于选择标签
this.navCtrl.parent.select(2,{
animation: true, direction: 'forward'
});
提前致谢
最佳答案
Ionic 目前无法做到这一点,但您可以使用 this amazing plugin实现这样的目标:
为了安装它,只需运行
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/