Actionbarsherlock - change the color of the action bar line

I am currently working on making my application compatible with version 3.0 devices using actionbarsherlock. My application has a custom theme that overlaps Holo.light, changing blue to orange.

I want to change the blue line that appears below the action bar to orange. With the official action bar, I succeeded by overriding

<item name="android:background">@drawable/ad_tab_unselected_holo</item> 

Unfortunately, this does not work in actionbarsherlock 4.

+6
source share
1 answer

You need to do two things:

ABS 4 now mimics the standard action bar with its attributes, so you need to add -

 <item name="background">@drawable/ad_tab_unselected_holo</item> 

Note the lack of android:

So your general code would look like this:

 <item name="android:background">@drawable/ad_tab_unselected_holo</item> <item name="background">@drawable/ad_tab_unselected_holo</item> 

Quote:

Due to limitations in the Android system for Android, any theme settings must be declared by two attributes. Normal Android prefix attributes apply the theme to their own action bar and unprefixed attributes apply to a custom implementation. since both thematic APIs are exactly the same, you only need to refer to your settings twice, instead of having to execute them twice.

I would also expand the Theme.Sherlock variable, and not holo, because, as I believe, holo is not available on older devices that are up to 3.0.

+5
source

Source: https://habr.com/ru/post/912603/


All Articles