antoniom
antoniom

Reputation: 3241

How to remove top shade on tab content

I have created an Android Tab Activity with the following XML code:

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

    <LinearLayout
        android:orientation="vertical"
        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_marginBottom="5dp"
             />

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"  />

       </LinearLayout>
</TabHost>

The first tab renders a WebView in its own layout file like this:

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center|top"
android:orientation="vertical"
android:layout_margin="0dp" android:padding="0dp">

<ScrollView
    android:layout_width="match_parent" android:layout_height="match_parent"
    android:layout_margin="0dp" android:padding="0dp">

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:layout_margin="0dp" android:padding="0dp">

        <WebView android:id="@+id/webview"
            android:layout_height="match_parent" android:layout_width="fill_parent" android:background="#00000000"
            android:layout_margin="0dp" android:padding="0dp"
            />

        <Button android:id="@+id/next" android:layout_width="fill_parent" android:layout_height="fill_parent"
            android:text="@string/hotelPhotosBtn" android:layout_marginLeft="8dp" android:layout_marginRight="8dp"/>
    </LinearLayout>        

</ScrollView>

And the result is the activity to render something like this: enter image description here

My Question is: Why this shade appears inside the tab content ? How can i remove it ? I have tried everything to remove it but it keeps on appearing.

I have read this and this but noone helped.

Upvotes: 2

Views: 646

Answers (1)

Samir Mangroliya
Samir Mangroliya

Reputation: 40426

setStripEnabled(false);

Look at this Android Developer web

http://developer.android.com/reference/android/widget/TabWidget.html#setStripEnabled%28boolean%29

Upvotes: 3

Related Questions