проблема в добавлении панели вкладок в нижней части экрана в Android - PullRequest
0 голосов
/ 09 мая 2011

В моем приложении у меня есть панель вкладок. Он содержит четыре вкладки, в которых я показываю вид списка. Работало нормально, но теперь мне нужно переместить панель вкладок в нижнюю часть экрана. Когда я изменил свой код, чтобы показать панель вкладок в нижней части представления, представления списка также отображаются в полноэкранном режиме, перекрывая панель вкладок.

Вот пример кода

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
             android:id="@+id/mainlayout"
             android:layout_height="fill_parent" 
             android:layout_width="fill_parent"
             android:orientation="vertical" >
    <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"
        android:orientation="vertical"
        android:background="#000000">

        <RelativeLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:padding="5dp">

            <TextView xmlns:android="http://schemas.android.com/apk/res/android"
                    android:id="@+id/Label"
                    android:layout_width="fill_parent" 
                    android:layout_height="wrap_content" 
                    android:text="Credit Balance"
                    android:background = "#55000000"
                    android:textColor = "#FF0033"
            />

            <TabWidget
                    android:id="@android:id/tabs"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content" 
                    **android:layout_alignParentBottom = "true"**/>
            <FrameLayout
                    android:id="@android:id/tabcontent"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:padding="5dp" />
        </RelativeLayout>
    </TabHost>
</FrameLayout>

Я добавляю 4 списка в 4 соответствующих вкладках со следующим кодом

 tabHost.addTab(tabHost.newTabSpec(NEW_TAB).setIndicator(NEW)
            .setContent(new Intent(this, NEWActivity.class)));

Пожалуйста, кто-нибудь может предложить решение этой проблемы?

Спасибо

1 Ответ

3 голосов
/ 09 мая 2011

добавить

android:layout_above="@android:id/tabs"

строка к вашему FrameLayout и с

android:layout_alignParentBottom = "true"

в TabWidget

...