2

簡単な質問があると思います。

私はタブを操作していて、私のxmlコードは次のとおりです。

<TabHost android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/tabHost"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<TabWidget
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@android:id/tabs"
/>
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@android:id/tabcontent"
>
    <LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/tab1"
    android:orientation="vertical"
    android:paddingTop="100px"
    >
    <TextView 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" 
    android:id="@+id/teste" />
    </LinearLayout>
    <LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/tab2"
    android:orientation="vertical"
    android:paddingTop="60px"
    >
    </LinearLayout> 
    <LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/tab3"
    android:orientation="vertical"
    android:paddingTop="60px"
    >
    </LinearLayout>
</FrameLayout>
</TabHost>

問題は、上部のパディングを削除すると、タブを開いたときにタブのコンテンツがその上に表示されることです。

この方法で問題が発生することはありませんか?コンテンツがそれを超えないようにするにはどうすればよいですか?

4

1 に答える 1

1

TabWidgetFrameLayoutを縦に入れてみてくださいLinearLayout。これにより、が強制的FrameLayoutに下になりTabWidgetます。

于 2012-05-16T16:23:19.183 に答える