Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to arrange three linearlayouts?
    text
    copied!<p>I have four LinearLayouts, top one as a wrapper, the rest containing objects. I'd like the center one (with the ListView) to fill my screen. So, I should see button1, then the List of items that's scrollable, and then button2 at the bottom of the screen.</p> <p>If I try setting the layout_height property of either the LinearLayout or ListView, I lose button2.</p> <p>Maybe, I shouldn't even be using LinearLayouts? Any suggestions are greatly appreciated! My layout XML is below. </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"&gt; &lt;LinearLayout android:id="@+id/linearLayout1" android:layout_width="match_parent" android:layout_height="wrap_content"&gt; &lt;Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/Button&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:id="@+id/linearLayout3" android:layout_width="match_parent" android:layout_height="wrap_content"&gt; &lt;ListView android:id="@+id/android:list" android:layout_width="fill_parent" android:layout_height="wrap_content" xmlns:android="http://schemas.android.com/apk/res/android" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:id="@+id/linearLayout2" android:layout_width="match_parent" android:layout_height="wrap_content"&gt; &lt;Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom"&gt;&lt;/Button&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre>
 

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