Android проблема с макетом горизонтальной упаковки - PullRequest
0 голосов
/ 07 декабря 2011

У меня проблемы с получением содержимого для заполнения ширины с помощью следующего макета.

Когда я добавляю материал в contentPane, он всегда действует как wrap_content независимо от того, что сам дочерний элемент указал.Я попытался изменить гравитацию, чтобы заполнить, и результат тот же.Чего мне не хватает?

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+bottom_button_panel/root"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="fill_horizontal"
xmlns:android="http://schemas.android.com/apk/res/android">

<LinearLayout
    android:id="@+bottom_button_panel/contentPane"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="fill_horizontal"
    android:layout_gravity="center_horizontal"/>

<RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_alignParentBottom="true"
        style="@style/buttonPanel">
    <LinearLayout
        android:id="@+bottom_button_panel/leftAlignedButtons"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"/>
    <LinearLayout
        android:id="@+bottom_button_panel/centerAlignedButtons"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"/>
    <LinearLayout
        android:id="@+bottom_button_panel/rightAlignedButtons"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_alignParentTop="true"
        android:layout_alignParentRight="true"/>
</RelativeLayout>
</RelativeLayout>

1 Ответ

0 голосов
/ 07 декабря 2011

сделать android:layout_height="fill_parent" из всех ваших макетов.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...