Ionic framework 单页上的Ionic自定义后退按钮
我看了看: 此页面使用了一个示例,其中离子选项卡上的选项卡位置针对该元素进行了更改 我试图用以下方法重新创建:Ionic framework 单页上的Ionic自定义后退按钮,ionic-framework,Ionic Framework,我看了看: 此页面使用了一个示例,其中离子选项卡上的选项卡位置针对该元素进行了更改 我试图用以下方法重新创建: <ion-header> <ion-navbar backButtonIcon="close"> <ion-title>settings-edit</ion-title> </ion-navbar> </ion-header> <ion-content padding> </ion-
<ion-header>
<ion-navbar backButtonIcon="close">
<ion-title>settings-edit</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
</ion-content>
设置编辑
导航栏后退按钮似乎没有任何更改,如文档中所示,您应该在
app.module.ts中定义它
将此添加到@NgModule:
imports: [
BrowserModule,
IonicModule.forRoot(MyApp, {
backButtonIcon: 'close',
iconMode: 'ios',
modalEnter: 'modal-slide-in',
modalLeave: 'modal-slide-out',
tabsPlacement: 'bottom',
pageTransition: 'ios-transition'
})
]
爱奥尼亚没有自定义后退按钮选项,只需将其更改为按钮即可
<ion-header>
<ion-navbar hideBackButton="true">
<button ion-button menuToggle hideBackButton="true">
<ion-icon name="md-close" (click)="close()" ></ion-icon>
</button>
<ion-title>settings-edit</ion-title>
</ion-navbar>
</ion-header>
close()
{
this.navctrl.pop();
}