babi
babi

Reputation: 799

How to get rid of black line under tabview?

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 ?

Upvotes: 1

Views: 717

Answers (4)

bindal
bindal

Reputation: 1932

You can put this in tabwidget

android:tabStripEnabled="false"

to remove that line

Upvotes: 1

user647826
user647826

Reputation:

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...

Upvotes: 3

Tofeeq Ahmad
Tofeeq Ahmad

Reputation: 11975

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

Upvotes: 1

georgiecasey
georgiecasey

Reputation: 23391

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.

Upvotes: 0

Related Questions