本文介紹了如何從 Ionic 2 中的后退按鈕更改標(biāo)簽?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!
問(wèn)題描述
附上代碼:
<ion-navbar *navbar>
</ion-navbar>
后退按鈕已啟用.但我需要自定義它(圖標(biāo)或標(biāo)簽).是否可以?在 docs/api 中找不到任何內(nèi)容.
the back button is enabled. But I need to customize it (the icon or the label). Is it possible? Can't find anything in the docs/api.
推薦答案
您可以在您的 app.html 中設(shè)置返回按鈕文本,如 ionic 鏈接 http://ionicframework.com/docs/v2/api/config/Config
you can set back button text in your app.html as mentioned in the ionic link http://ionicframework.com/docs/v2/api/config/Config
@App({
template: `<ion-nav [root]="root"></ion-nav>`
config: {
backButtonText: 'Go Back',
iconMode: 'ios',
modalEnter: 'modal-slide-in',
modalLeave: 'modal-slide-out',
tabbarPlacement: 'bottom',
pageTransition: 'ios',
}
})
ionic 2 beta 8 中的更新
import {ionicBootstrap} from 'ionic-angular';
ionicBootstrap(AppRoot, customProviders, {
backButtonText: 'Go Back',
iconMode: 'ios',
modalEnter: 'modal-slide-in',
modalLeave: 'modal-slide-out',
tabbarPlacement: 'bottom',
pageTransition: 'ios',
});
ionic 2 rc.0 及更高版本以及 ionic 3 中的更新
在 ionic 2 rc.0 及更高版本中,我們需要在導(dǎo)入數(shù)組下的 app.module.ts 中包含配置.
In ionic 2 rc.0 and up, we need to include the configs in app.module.ts under imports array.
@NgModule({
declarations: [
MyApp,
Home
],
imports: [
IonicModule.forRoot(MyApp, {
tabsPlacement: 'top',
backButtonText: 'Back'
})],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
Home ],
providers: [MyService]
})
這篇關(guān)于如何從 Ionic 2 中的后退按鈕更改標(biāo)簽?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!