Как избавиться от горизонтальной полосы прокрутки в tabhost? - PullRequest
3 голосов
/ 14 июля 2010

Я хочу избавиться от горизонтальной полосы прокрутки в TabHost.Он есть даже в том случае, если TabWidget находится сверху.

альтернативный текст http://img341.imageshack.us/img341/1879/brokentabs.png

Ниже приведен мой XML-макет.

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

Ответы [ 2 ]

2 голосов
/ 20 мая 2011

Поместив это работало для меня в макет кадра:

android:foreground="@null"
android:layout_marginTop="-6dp"
2 голосов
/ 15 июля 2010

Вложите его в линейный переход

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