动作栏颜色在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>
答案 0 :(得分:3)
使用以下格式
<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>
操作栏将由colorPrimary
答案 1 :(得分:2)
以下代码适用于我:
<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>