Android TabActivity - PullRequest
       18

Android TabActivity

1 голос
/ 23 апреля 2011

Здравствуйте, я пытаюсь сделать макет следующим образом:

--------------------|
|Tab1 | Tab2 | Tab3 |
--------------------|
|                   |
|                   |
|                   |
--------------------|

Внутри вкладки 1 Мне нужны другие вкладки

--------------------|
|Tab1 | Tab2 | Tab3 |
--------------------|
|TAB A   |  TAB B   |
--------------------|                        |
|                   |
|                   |
|                   |
--------------------|

Я использую XML-файлы: main.xml

<?xml version="1.0" encoding="utf-8"?>
<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"
        android:padding="5dp">      


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

        <FrameLayout android:id="@android:id/tabcontent"
            android:layout_width="fill_parent" android:layout_height="fill_parent"
            android:padding="5dp" />

    </LinearLayout>

</TabHost>

и tablevel2.xml

<?xml version="1.0" encoding="utf-8"?>

<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/my_tabhost" 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" />

    <FrameLayout android:id="@android:id/tabcontent"
        android:layout_width="fill_parent" android:layout_height="fill_parent"
        android:padding="5dp" />

</TabHost>

Но это не работает, потому что содержимое в TabB перекрывает содержимое из tab1.Conent - другая активность.

...