Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need a definitive answer for styling Android ActionBar tabs

I've started my app with these two examples in mind:

http://code.google.com/p/iosched/

http://developer.android.com/resources/samples/HoneycombGallery/index.html

It currently has

minSdkVersion = 8 minSdkTarget = 11

set up in my manifest. I've tried everything I can think of, but can't seem to get the styling I want. I've accomplished a lot of styling, but one thing eludes me still...the tabs. I can't find any way to color them.

Now before I get too far, and before you tell me I missed something obvious, is it even possible to change the colors of the tabs on Android 3.1...or even 3.0 for that matter (the normally bright blue underlines)? It seems I can do most everything else...

I've looked all over for the answer. Including these places and many, many more...

http://developer.android.com/guide/topics/ui/actionbar.html

http://android-developers.blogspot.com/2010/05/twitter-for-android-closer-look-at.html

http://developer.android.com/resources/samples/ActionBarCompat/index.html

http://android-developers.blogspot.com/2011/04/customizing-action-bar.html

Android 3.0 ActionBar, changing colors

Android action bar like twitter sample

Android ActionBar tab style for Honeycomb

http://groups.google.com/group/android-developers/browse_thread/thread/983509d7261c54f4

If nothing else, this is a decent list of links for those looking...

Thanks

like image 853
Metallicraft Avatar asked Nov 02 '11 23:11

Metallicraft


1 Answers

<style name="MyTheme.Light" parent="@android:style/Theme.Holo.Light">
  <item name="android:windowActionBarOverlay">true</item>
  <item name="android:actionBarTabStyle">@style/customActionBarTabStyle</item>
  <item name="android:actionBarTabTextStyle">@style/customActionBarTabTextStyle</item>
</style>
    <style name="customActionBarTabTextStyle">
            <item name="android:textColor">@android:color/white</item>
    </style>
    <style name="customActionBarTabStyle">
            <item name="android:background">@drawable/actionbar_tab_bg</item>
            <item name="android:paddingLeft">24dp</item>
            <item name="android:paddingRight">24dp</item>
    </style>
like image 95
Amol Avatar answered Nov 19 '22 22:11

Amol