1

I want to apply Black Line Under the TabView,

Here is My Code,

<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
         android:id="@android:id/tabhost" 
         android:layout_width="fill_parent"
         android:background="#ffffff"
         android:layout_marginTop="40dip"    
         android:layout_height="fill_parent">                      
     <LinearLayout  android:orientation="vertical" 
                    android:background="#ffffff" 
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"> 
       <TabWidget  android:id="@android:id/tabs" 
                   android:layout_width="fill_parent" 
                   android:tabStripEnabled="false" 
                   android:layout_marginBottom="-3dp" 
                   android:layout_height="40dip"
                   android:layout_marginLeft="0dip" 
                   android:layout_marginRight="0dip" />
       <FrameLayout android:id="@android:id/tabcontent" 
                    android:background="#ffffff" 
                    android:layout_height="fill_parent" />

Can Anyone tell me how to do it ?

Hiral Vadodaria
  • 19,158
  • 5
  • 39
  • 56
babi
  • 779
  • 1
  • 6
  • 6

4 Answers4

3

Apply a custom theme to your activity, and null out the android:windowContentOverlay attribute.

Define a theme in themes.xml:

<style name="YourTheme">
  ...   
  <item name="android:windowContentOverlay">@null</item>
  ...
</style>

Apply the theme on your application or the activity in AndroidManifest.xml:

<application android:theme="@style/YourTheme"
  ... >

Hope it helps. It caused me lots of headache...

1

A few days ago i met with same issue.I have gone through stackoverflow.There are various question are already present.So go through below link

How to remove gray scale border from tab layout

Community
  • 1
  • 1
Tofeeq Ahmad
  • 11,935
  • 4
  • 61
  • 87
1

You can put this in tabwidget

android:tabStripEnabled="false"

to remove that line

bindal
  • 1,940
  • 1
  • 20
  • 29
0

Are you talking about the divider at the bottom of the TabWidget? If so, simply add android:layout_marginBottom="-5px" to the TabWidget. This will move the TabWidget off the bottom of the screen 5 pixels, just enough so you don't see the divider.

The FrameLayout, which I assume you're using, will compensate in size so it works out perfectly.

georgiecasey
  • 21,793
  • 11
  • 65
  • 74