Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Have you thought about creating your ListView completely dynamically? In other words, try programmatically creating your ListView, and then manually add it to your layout.</p> <p>Also, is there any reason in particular that you want to specify the ListView height manually? Your ListView will automatically resize itself anyway depending on the amount of data you have, and if you have more data than that could fit on the screen, it will become scrollable.</p> <h2>Edit</h2> <p>In reference to your second comment and your included XML layout, here's what I suggest you do.</p> <p>Your XML file should only have one root element (hence why it's called the root). Currently, you have a ScrollView and a LinearLayout. I suggest you just use a LinearLayout as the root. You can use this as a rough skeleton:</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent" android:layout_width="fill_parent" ... &gt; &lt;ListView ... android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_weight="1" /&gt; &lt;TableLayout ... android:layout_height="fill_parent" android:layout_width="wrap_content" android:layout_weight="0" /&gt; &lt;Button ... android:layout_height="fill_parent" android:layout_width="wrap_content" android:layout_weight="0" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>This layout basically pushes your Button to the very bottom, and your TableLayout to the bottom, but above the Button. Your ListView will take the rest of the space above the the TableLayout. (By the way, a TableRow is basically a specialized LinearLayout. You can simply replace the TableLayout with a horizontal LinearLayout to achieve similar results, unless you plan to add multiple rows to the table and need equal sizing for the columns.)</p>
 

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