2

I'm following this tutorial : http://www.androidhive.info/2011/08/android-tab-layout-tutorial/ and I want to change view of tabLayout. I've changed color of tabbed buttons by:

tabHost.getTabWidget().getChildAt(i).setBackgroundColor(Color.parseColor("#878787"));

But there is one change I need to do, how to change this thin orange line under the tabbed buttons? : Orange thin line

Cichy
  • 1,319
  • 3
  • 20
  • 36
  • you will need to create Custom Tab see this tut http://android-codes-examples.blogspot.in/2011/09/customize-tab-in-android.html – ρяσѕρєя K Jul 30 '12 at 13:10
  • http://stackoverflow.com/questions/5754668/how-to-change-default-color-to-tab-host check this link, it some what relates to your question may it helps you – vinay kumar Jul 30 '12 at 13:13

2 Answers2

1

It is better to disable it because when you try to change color of it then i think there is no line effect is show line and tab color is merged.

you can disable it using the android:tabStripEnabled XML attribute.

In AndroidManifest.xml:

 <activity android:name=".ActivityName" android:theme="@style/tabTheme"/> 

In values/styles.xml:

 <style name="tabTheme" parent="android:style/Theme"> 
      <item name="android:tabWidgetStyle">@style/Widget.TabWidget</item>
 </style> 

 <style name="Widget.TabWidget" parent="android:Theme"> 
      <item name="android:tabStripEnabled">false</item>
 </style>
Chirag
  • 56,621
  • 29
  • 151
  • 198
0

Or you can to try this in your code;

TabHost tabHost = getTabHost();
tabHost.getTabWidget().setStripEnabled(false);
lfrancatto
  • 107
  • 1
  • 1
  • 10