0

タブウィジェットの上にボタンを追加しようとしていますが、ボタンは常にタブウィジェットのタブの下に表示されます。ボタンは各タブに表示されるようにフロントレイヤーに表示されます。

タブウィジェットの上にウィジェットを表示することは可能でしょうか?

ウィジェットの配置に関するアイデアを提供するためのレイアウト例を次に示します。注:このレイアウトは機能しません。

<ImageButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@android:drawable/sym_action_chat" />  

<ImageButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@android:drawable/sym_action_email" />


<TextView android:id="@+id/view1"
    android:background="@drawable/blue"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:text="@string/tabs_1_tab_1"/>

<TextView android:id="@+id/view2"
    android:background="@drawable/red"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:text="@string/tabs_1_tab_2"/>

<TextView android:id="@+id/view3"
    android:background="@drawable/green"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:text="@string/tabs_1_tab_3"/>

4

1 に答える 1

1

developer.android.com のリソースによると

TabHost は、タブを表示するための TabWidget とタブのコンテンツを表示するための FrameLayout の両方を含むレイアウトのルート ノードである必要があります。

だから私はあなたがそれをすることはできないと思うし、見栄えもしないだろう.

于 2010-07-21T10:44:30.923 に答える