0

図のようなタブバーを設定しようとしています ここに画像の説明を入力してください

これが私のxmlファイルです`

<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:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >

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

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="match_parent"
            android:layout_height="30sp"
            android:layout_marginBottom="40sp"
            android:layout_marginLeft="70sp"
            android:layout_marginRight="70sp"
            android:layout_weight="0"
            android:background="@drawable/rounded_corners_white_bg"
            android:tabStripEnabled="false" >
        </TabWidget>

    </LinearLayout>

</TabHost>`

左、右、下の余白を設定することで、私は今までこれを手に入れましたここに画像の説明を入力してください。この図では、タブバーが下部に表示されており、背景色は黒で表示されています。背景色が黒いため、アクティビティのコンテンツが表示されません。誰か助けてもらえますか???????????

4

1 に答える 1

0

レイアウトファイルの左側、右側、下部にスペースを与えてみました。ここでは正常に動作しています。他のレイアウトを外側で使用していますか..?または@ drawable/rounded_corners_white_bgが原因である可能性があります。背景には、「#cd9089」のような他の色を使用します。

于 2013-01-30T09:47:42.593 に答える