1

I created android application. I created custom theme for my app. I want to change the toolbar color. How to do. I wrote some code but its not working. Please anyone fix it.

Here my code:

<style name="CustomActionBarTheme"
    parent="@android:style/Theme.Holo.Light">
    <item name="android:actionBarStyle">@style/MyActionBar</item>
    <item name="android:colorPrimary">@color/myPrimaryColor</item>
    <!-- Support library compatibility -->
    <item name="actionBarStyle">@style/MyActionBar</item>
    <item name="colorPrimary">@color/myPrimaryColor</item>
</style>

<!-- general styles for the action bar -->
<style name="MyActionBar"
    parent="@android:style/Widget.Holo.ActionBar">
    <item name="android:titleTextStyle">@style/TitleTextStyle</item>
    <!-- Support library compatibility -->
    <item name="titleTextStyle">@style/TitleTextStyle</item>

</style>

<!-- action bar title text -->
<style name="TitleTextStyle"
    parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
    <item name="android:textColor">@color/myAccentColor</item>
</style>

Thanks in advance

Razul
  • 99
  • 1
  • 12

1 Answers1

0

i'm suggesting you to use material design in your app, then you can add toolbar which replaces actionbar and its very easy to customize toolbar. For more info on material design backward compatability follow : http://antonioleiva.com/material-design-everywhere/ , http://www.truiton.com/2015/02/android-material-design-backward-compatibility/

                      if you still want to customize actionbar then follow this link :http://stackoverflow.com/questions/19977081/how-to-change-the-color-of-the-android-actionbar-without-using-any-image-resourc it worked for me.

hope these links help you !

rajeev kumar
  • 239
  • 1
  • 4
  • 11