3

TabHost の水平スクロール バーを削除したい。TabWidget が上にある場合でも、そこにあります。

代替テキスト

以下は私の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>
4

2 に答える 2

2

これをフレームレイアウトに入れるとうまくいきました:

android:foreground="@null"
android:layout_marginTop="-6dp"
于 2011-05-20T10:09:30.427 に答える
2

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>
于 2010-07-15T19:06:44.913 に答える