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 回答