操作栏颜色在 android 中没有改变(棒棒糖)
Actionbar color not changing in android (Lollipop)
Actionbar 颜色在 android (Lollipop) 中没有改变,这是我的 styles.xml 代码
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="android:actionBarStyle">@style/MyActionBar</item>
</style>
<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#EBE1CE</item>
</style>
</resources>
使用以下样式
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/primaryDef</item>
<item name="colorPrimaryDark">@color/primaryDarkDef</item>
<item name="colorAccent">@color/primaryDef</item>
<item name="android:navigationBarColor">@color/primaryDarkDef</item>
<item name="android:activatedBackgroundIndicator">@drawable/defbg</item>
</style>
Action Bar 的颜色为colorPrimary
下面的代码适合我:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="actionBarStyle">@style/Widget.ActionBar</item>
</style>
<style name="Widget.ActionBar" parent="Widget.AppCompat.ActionBar">
<item name="height">100dp</item>
<item name="background">#EBE1CE</item>
</style>
</resources>
Actionbar 颜色在 android (Lollipop) 中没有改变,这是我的 styles.xml 代码
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="android:actionBarStyle">@style/MyActionBar</item>
</style>
<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#EBE1CE</item>
</style>
</resources>
使用以下样式
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/primaryDef</item>
<item name="colorPrimaryDark">@color/primaryDarkDef</item>
<item name="colorAccent">@color/primaryDef</item>
<item name="android:navigationBarColor">@color/primaryDarkDef</item>
<item name="android:activatedBackgroundIndicator">@drawable/defbg</item>
</style>
Action Bar 的颜色为colorPrimary
下面的代码适合我:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="actionBarStyle">@style/Widget.ActionBar</item>
</style>
<style name="Widget.ActionBar" parent="Widget.AppCompat.ActionBar">
<item name="height">100dp</item>
<item name="background">#EBE1CE</item>
</style>
</resources>