Actionbar color not changing in android (Lollipop), here is my styles.xml code
<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>
Use following style
<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>
The Action Bar will be colored by colorPrimary
The below code works fine for me:
<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>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.