Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make a linearlayout filling remaining space in a relativelayout?
    primarykey
    data
    text
    <p>I've got a relativelayout with three linearlayouts as children. The last one has a fixed height and has android:layout_alignParentBottom set to "true". While the middle one is properly positioned below the first one, it goes as far as the bottom of the screen, so that its lower part is overlapped by the third one.</p> <p>What's wrong?</p> <p>Thanks</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;LinearLayout android:id="@+id/category" android:layout_width="fill_parent" android:layout_height="50dp" android:layout_alignParentTop="true" android:orientation="horizontal" &gt; &lt;ImageView android:id="@+id/back_btn" android:layout_width="29dp" android:layout_height="34dp" android:layout_gravity="center_vertical" android:src="@drawable/red_arrow_left" /&gt; &lt;TextView android:id="@+id/cat_name" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:gravity="center" android:textSize="20sp" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@+id/category" android:layout_marginTop="10dp" android:orientation="horizontal" &gt; &lt;ListView android:id="@+id/android:list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@android:color/white" android:cacheColorHint="@android:color/white" /&gt; &lt;TextView android:id="@+id/android:empty" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@android:color/white" android:cacheColorHint="@android:color/white" android:padding="10dp" android:text="@string/no_item" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/nav_bar" android:layout_width="fill_parent" android:layout_height="40dp" android:layout_alignParentBottom="true" android:orientation="horizontal" &gt; //stuff &lt;/LinearLayout&gt; &lt;/RelativeLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload