如果你使用你的應用程序中SCSS,你可以創建自己的自定義欄類,並使用離子型的吧mixin在裏面。
$bar-custom-bg: #ccc;
$bar-custom-border: #eee;
$bar-custom-text: #fff;
$bar-custom-active-border: darken($bar-custom-border, 10%);
$bar-custom-active-bg: darken($bar-custom-bg, 10%);
.bar {
&.bar-custom {
@include bar-style($bar-custom-bg, $bar-custom-border, $bar-custom-text);
&.bar-footer{
background-image: linear-gradient(180deg, $bar-custom-border, $bar-custom-border 50%, transparent 50%);
}
.button {
@include button-style($bar-custom-bg, $bar-custom-border, $bar-custom-active-bg, $bar-custom-active-border, $bar-custom-text);
@include button-clear(#fff, $bar-title-font-size);
}
}
}
定義您的課程後,您可以使用您的新的自定義欄類與ion-nav-bar指令。
<ion-nav-bar class="bar-custom">
<ion-nav-back-button></ion-nav-back-button>
</ion-nav-bar>
您是否在'index.html'文件中'ion-nav-bar'標記中更改類?恩。 '' –
shakib
我試圖爲每個頁面設置不同的顏色,而不是每個頁面都使用相同的顏色。 – poiuytrez