2

次のXMLコードを使用してAndroidタブアクティビティを作成しました。

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

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="5dp"
             />

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

       </LinearLayout>
</TabHost>

最初のタブは、次のように独自のレイアウトファイルでWebViewをレンダリングします。

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center|top"
android:orientation="vertical"
android:layout_margin="0dp" android:padding="0dp">

<ScrollView
    android:layout_width="match_parent" android:layout_height="match_parent"
    android:layout_margin="0dp" android:padding="0dp">

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:layout_margin="0dp" android:padding="0dp">

        <WebView android:id="@+id/webview"
            android:layout_height="match_parent" android:layout_width="fill_parent" android:background="#00000000"
            android:layout_margin="0dp" android:padding="0dp"
            />

        <Button android:id="@+id/next" android:layout_width="fill_parent" android:layout_height="fill_parent"
            android:text="@string/hotelPhotosBtn" android:layout_marginLeft="8dp" android:layout_marginRight="8dp"/>
    </LinearLayout>        

</ScrollView>

その結果、次のようなものをレンダリングするアクティビティが作成されます。 ここに画像の説明を入力してください

私の質問は:なぜこの色合いがタブコンテンツ内に表示されるのですか?どうすれば削除できますか?私はそれを取り除くためにすべてを試みましたが、それは現れ続けます。

私はこれこれを読みましたが、誰も助けませんでした。

4

1 に答える 1

3
setStripEnabled(false);

このAndroid Developer Webを見てください

http://developer.android.com/reference/android/widget/TabWidget.html#setStripEnabled%28boolean%29

于 2012-02-29T09:01:59.153 に答える