0

I am using the appcompat support library and I want to change the color of the action bar tabs. I found these instructions in which the customize tab indicator section suggests creating a file res/drawable/actionbar_tab_indicator.xml declaring a specific background image for several different states of an action bar tab.

actionbar_tab_indicator.xml looks like :

<!-- STATES WHEN BUTTON IS NOT PRESSED -->

    <!-- Non focused states -->
    <item android:state_focused="false" android:state_selected="false"
          android:state_pressed="false"
          android:drawable="@drawable/tab_unselected" />

...

The @drawable/* images are nine patches. However, i do not want to get involved in creating nine-patches images. Is there another way to change the actionbar tab's color?

zoe vas
  • 281
  • 9
  • 25

1 Answers1

0

I wrote an answer to that question 1 year ago.

You can find in here: Change Color TabSelector on v4 ViewPager

Community
  • 1
  • 1
mmBs
  • 8,421
  • 6
  • 38
  • 46
  • So, the only way to change the actionbar tabs color is to create 9 patches(either creating them manually or automatically by the site you provide)? – zoe vas Aug 13 '14 at 11:51
  • It's the easiest and the fastest way to do that. But you can do it programmatically as well: http://stackoverflow.com/questions/18486571/is-it-possible-to-change-actionbar-tab-indicator-programmatically – mmBs Aug 13 '14 at 12:00
  • @zoevas Did it help you? Or you need a different approach? – mmBs Aug 14 '14 at 13:03
  • Yes, i have used the action bar style generator! Thank you! – zoe vas Aug 19 '14 at 07:44