views:

163

answers:

1

I'm trying to add buttons above a tab-widget but they are always displayed under the tab-widget's tabs. The buttons are displayed on front layer so that they appear on each tab.

Does anybody have an idea is it possible at all to display any widgets above the tab-widget?

Here's an example layout to give some idea on the placement of the widgets. Note: this layout is not functional.

<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"/>

+1  A: 

according to resources at developer.android.com

The TabHost must be the root node for the layout, which contains both the TabWidget for displaying the tabs and a FrameLayout for displaying the tab content.

so I think you can not do that, nor would it look nice, imho.

ruslanoid
Hmmm. With that said, I still wonder if it is possible to put the tabWidget in a linearlayout and define another linearlayout above it with some buttons? Quite a hack I suppose.
Brad Hein