0

I am running the latest eclipse with the latest Android support library, API 23. by default, the support library along with material design gets added to a new project as far as i know (Compile with API 23).

But i want to change the ActionBar's color, earlier it was not possible on API <11 as it used android's built in library. now i am sure they added action bar in the support library as i tested my project on an android 2.3 device and i see the action bar, so compatibility is not an issue here.

So how do i change my action bar and button's colors?

EDIT::The suspected duplicate does Not solve my problem, i have tried that already, it gives me api level error when i define theme in the styles.xml. i have included the link in my question already.

Community
  • 1
  • 1
abbie
  • 345
  • 5
  • 22
  • eclipse has support of API 23? – xAqweRx Jun 07 '16 at 14:38
  • Possible duplicate of [How do I change the background color of the ActionBar of an ActionBarActivity using XML?](http://stackoverflow.com/questions/8024706/how-do-i-change-the-background-color-of-the-actionbar-of-an-actionbaractivity-us) – xAqweRx Jun 07 '16 at 14:38
  • actually yes (checked last time february). this isn't ADT bundle, and you can't update ADT bundle either, i downloaded everything individually. – abbie Jun 07 '16 at 14:39
  • why marked as duplicate? – abbie Jun 07 '16 at 14:45
  • 2
    Without code, xml layours and your theme is not clear what exactly you want to do. And duplicate link answers title question. And from context of question -> answers the question. – xAqweRx Jun 07 '16 at 14:49

1 Answers1

1

Edit your styles.xml file. The colorPrimary will be your action bar color and the colorPrimaryDark is the status bar color.

Note: Make sure this theme is set as your activities theme in your manifest.

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimaryDark</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDarkDark</item>
</style>
Jay
  • 324
  • 2
  • 14
  • yeah, AppTheme is set by default. BTW is it possible to change statusbar color in api 9 – abbie Jun 07 '16 at 15:28
  • it didn't change the statusbar color on gingerbread, but it worked on lollipop. can you complete your answer? this is just the statusbar. how do i change other widget's color like buttons? – abbie Jun 07 '16 at 15:33
  • i have checked your answer, you will get an up vote if you complete it – abbie Jun 07 '16 at 15:34
  • I'm not sure as I haven't done that before, but try this @color/splash_title – Jay Jun 07 '16 at 15:38