Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android ActionBar tab style for Honeycomb

I am using the HoneycombGallery sample app in the SDK and attempting to change the style of the ActionBar tabs (i.e., "Balloons", "Bikes", "Androids", "Pastries"). Using the "light" theme, the tabs have a blue underline. I simply want to make this red to match the style of an application I'm working on.

I've tried researching styles in the SDK documentation (http://developer.android.com/guide/topics/ui/actionbar.html) and other sources on the web, but I'm not quite certain that I understand what property/attribute controls this particular style of the tabs.

If anyone has a resource or code example that might demonstrate a complete custom styling of the ActionBar, I would appreciate it.

like image 483
Kyle Avatar asked Mar 18 '11 14:03

Kyle


1 Answers

You'll want to be familiar with applying a custom theme to an activity. http://developer.android.com/guide/topics/ui/themes.html

The theme attributes android:actionBarTabStyle, android:actionBarTabBarStyle, and android:actionBarTabTextStyle control the appearance of action bar tabs. The default styling uses android:background within the tab bar style for the thin line under unselected items, and a state list drawable as the android:background for the tabs themselves to handle focused/selected/pressed states. The background assets themselves are 9-patches that provide the underline in most cases but a more comprehensive highlight for pressed/focused states.

like image 176
adamp Avatar answered Sep 18 '22 12:09

adamp