Страница 1 из 1

расположение компонент. TabHost перекрывает LinearLayout2

Добавлено: 22 окт 2013, 11:15
Banhammer
в общем есть такая проблема. два LinearLayout, в первом висит TabHost во второй после определённого экшена добавляются два TextView. проблема в том, что их не видно полностью. первый TextView видно, и то кусочек, а второй TextView не видно полностью, тк TabHost не даёт второму LinearLayout полностью *распрямиться*. в чём проблема, подскажите, пожалуйста.

Код: Выделить всё

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/mainScreenLinearLayout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#FFFFFF"
    android:orientation="vertical" >

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_weight="1" >

    <TabHost
        android:id="@android:id/tabhost"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        <LinearLayout
            android:id="@+id/linearLaya"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:orientation="vertical" >

            <TabWidget
                android:id="@android:id/tabs"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="#000000" >
            </TabWidget>

            <FrameLayout
                android:id="@android:id/tabcontent"
                android:layout_width="match_parent"
                android:layout_height="match_parent" >
            </FrameLayout>
        </LinearLayout>
    </TabHost>

</LinearLayout>

<LinearLayout
    android:id="@+id/whatDoYouWantFromMe"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:orientation="vertical" >
</LinearLayout>

</LinearLayout>

Re: расположение компонент. TabHost перекрывает LinearLayout

Добавлено: 22 окт 2013, 21:56
trew
Вместо fill_parent рекомендуют использовать match_parent.
[syntax=xml] <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mainScreenLinearLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF"
android:orientation="vertical" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="2" >

<TabHost
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<LinearLayout
android:id="@+id/linearLaya"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#000000" >
</TabWidget>

<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</FrameLayout>
</LinearLayout>
</TabHost>

</LinearLayout>

<LinearLayout
android:id="@+id/whatDoYouWantFromMe"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >

</LinearLayout>

</LinearLayout> [/syntax]
Вес 2 к 1, можете поставить свои цифры.