2017-05-10 28 views
1

我想在導航到頁面時在離子3應用程序中進行動畫過渡。 我使用這個文件 enter image description here離子3導航過渡推送其他頁

我在app.module.ts

@NgModule({ 
    declarations: [ 
    MyApp, 
    ], 
    imports: [ 
    BrowserModule, 
    IonicModule.forRoot(MyApp,{ 
     PageTransition: 'wp-transition' 
    }), 
    AngularFireModule.initializeApp(FIREBASE_CONFIG) 
    ], 
    bootstrap: [IonicApp], 
    entryComponents: [ 
    MyApp, 
    ], 
    providers: [ 
    StatusBar, 
    SplashScreen, 
    {provide: ErrorHandler, useClass: IonicErrorHandler} 
    ] 
}) 
export class AppModule {} 

隨後宣佈,當我瀏覽頁我寫這篇

NavigateToPage(pageName: string){ 
    let opts = { animate: true, animation: "wp-transition",direction:'forward', duration: 2500} 
    pageName === 'TabsPage'? this.navCtrl.setRoot(pageName,opts) : this.navCtrl.push(pageName,opts); 
    } 

} 

但我不看到任何過渡,它看起來與以前一樣。 有什麼想法?

回答

0

我將它做這方面的工作(一push())在我的項目之一:所以 this.navCtrl.push(pageName,{/*here stay navParams - but for this example is empty, but still need to use {}*/},opts);

沒有評論:this.navCtrl.push(pageName,{},opts);