ionic2的返回按鈕的編輯問題

ionic2 返回按鈕

首先能夠在 app.module.ts 文件中配置。html

@NgModule 中的 imports 屬性的 IonicModule.forRoot 第二個參數,以下:app

IonicModule.forRoot(MyApp, {backButtonText: '', // 配置返回按鈕的文字backButtonIcon: 'arrow-dropleft-circle' // 配置返回按鈕的圖標 })ionic


  也能夠在 ion-toolbar 中配置自定義圖標,並添加 navPop 屬性便可,以下:
<ion-header>
<ion-toolbar>
<button ion-button clear small navPop style="padding: 0;">
<img class="back-btn" src="assets/image/back.png" />
</button><ion-title class="my-title">我是標題</ion-title>
</ion-toolbar>
</ion-header>

若是要禁用某個特定的頁面的返回按鈕,只須要給 ion-navbar 添加 hideBackButton="true" 屬性便可,以下:

 <ion-navbar hideBackButton="true">ide

 <ion-title>Sub Page</ion-title>post

</ion-navbar>spa

 

 

 

2018-08-18 00:50:20htm

相關文章
相關標籤/搜索