1

I am using Tabhost for project Tabs. I changed the color of the tab to blue but there is 2px line bellow the tab. Can any one help me to change the white color to blue. http://img816.imageshack.us/img816/228/device.png

Jana
  • 2,890
  • 5
  • 35
  • 45

2 Answers2

1

There's probably something wrong with your screen design not related to TabHost. Did you check the screen/widgets/layouts paddings?

The following code snippet does exactly what you want. Add another Tab and that's it.

<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" 
            android:layout_alignParentBottom="true"/>
        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_above="@android:id/tabs">

            <include android:id="@+id/tab1" layout="@layout/tab1" />

            <include android:id="@+id/tab2" layout="@layout/tab2" />

            <include android:id="@+id/tab3" layout="@layout/tab3" />
        </FrameLayout>
    </RelativeLayout>
</TabHost>
Maragues
  • 37,861
  • 14
  • 95
  • 96
  • 1
    Hi the padding problem exist only in sdk 1.5. When i changed my coding to 1.6, the white border disappeared automatically. – Jana Jun 30 '10 at 06:59
0

Android: Tabs at the BOTTOM

I don't know if there is still no interface to customize or disable the bar below the tabs, but would be interested in an answer as well.

Community
  • 1
  • 1
slup
  • 5,484
  • 4
  • 19
  • 14