How to get rid of horizontal scroll bar in tabhost?
Asked Answered
B

2

3

I want to get rid of horizontal scroll bar in TabHost. It's there even if TabWidget is on top.

alt text

Below is my xml layout.

<?xml version="1.0" encoding="utf-8"?>
<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" > 
    <FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="fill_parent"     
        android:layout_height="fill_parent"/>                 

    <TabWidget
        android:id="@android:id/tabs"                     
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:gravity="bottom" />
</TabHost>
Balance answered 14/7, 2010 at 10:49 Comment(0)
D
2

Nest it into a Linearlayout

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"

    android:gravity="center_horizontal">      
   <TabHost 
    android:id="@android:id/tabhost"    
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
...
...
...
    </TabHost>
    </LinearLayout>
Drinkable answered 15/7, 2010 at 19:6 Comment(0)
F
2

Putting this worked for me in the frame layout:

android:foreground="@null"
android:layout_marginTop="-6dp"
Fidelfidela answered 20/5, 2011 at 10:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.