tags:

views:

32

answers:

2

I need to have a layout that has a view above a set of tabs. I've gotten the tabs working fine, but as soon as I try to add a view outside of them I'm left with that view and no visible tabs.

This works fine:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <TabHost 
        android:id="@android:id/tabhost"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="1">
        <LinearLayout  ... />

But this doesn't:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <TextView  ... />  <!--  THIS LINE HERE!!!  -->
    <TabHost 
        android:id="@android:id/tabhost"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="1">
        <LinearLayout  ... />

What can I do to make my tabs co-exist with other views?


For the sake of completeness, my Activity extends TabActivity.

A: 

Mayby you should get rid of the initial LinearLayout and start with your tabhost, like in this tutorial? Or is your goal to have a set-up like the image below?

+-----------------+
| App Title       |
+-----------------+
| some text       |
+-----+-----+-----+
| tab | tab | tab |
+-----+-----+-----+
|                 |
BennySkogberg
Yes, that is my goal.
fiXedd
A: 

Actually, according to this article, it isn't possible. Grr.

fiXedd