0
我剛開始使用離子版v2,今天我嘗試着色我的應用程序以符合我的偏好。雖然使用顏色變量提供了一些顏色,但我無法找到如何爲每個導航欄添加顏色,儘管我可以單獨爲它們着色。我應該訪問哪些變量以使所有navbars具有相同的顏色?Ionic2全球導航欄着色
在此先感謝。
我剛開始使用離子版v2,今天我嘗試着色我的應用程序以符合我的偏好。雖然使用顏色變量提供了一些顏色,但我無法找到如何爲每個導航欄添加顏色,儘管我可以單獨爲它們着色。我應該訪問哪些變量以使所有navbars具有相同的顏色?Ionic2全球導航欄着色
在此先感謝。
這是因爲全球只有sigle類可以更改您的工具欄顏色gobally。
.toolbar-background{
background-color: "color you want to give" !important;
}
,或者你可以爲每個平臺像
.toolbar-wp-themecolor .toolbar-background-wp{
}
.toolbar-md-themecolor .toolbar-background-md{
}
.toolbar-ios-themecolor .toolbar-background-ios{
}
seperately做,或者如果你想與全球色彩變量來控制然後爲每個頁面,您可以使用像
<ion-header>
<ion-navbar color="themecolor">
<ion-title>Notifications</ion-title>
</ion-navbar>
</ion-header>
其中themeColor相關可以定義在變量中.scss
$colors: (
primary: #387ef5,
secondary: #32db64,
danger: #f53d3d,
light: #f4f4f4,
dark: #222,
white: #ffffff,
themecolor: #574D70
);