如果你使用你的应用程序中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