Note that there are some explanatory texts on larger screens.

plurals
  1. POListView item on form only showing one item
    primarykey
    data
    text
    <p>I have a form with a number of EditView fields in it. The data for these fields are loaded from a database (in the onCreate() method). The last object on the screen should be a ListView that should show all related data records to the record being show. All the data is correctly loading, and the adapter for this seems to work ok. It loads the correct data, it formats the data correctly into the two-line layout specified by the .xml used by the adapter. </p> <p>The problem is that the ListView on the screen is "shrunk" to show only one item, and adds a scrollbar if there's more items. I expected the ListView to expand in size to show all records, and the screen itself being scrollable (everything is wrapped inside a ScrollView). </p> <p>So, the XML looks like this:</p> <pre><code>&lt;ScrollView android:layout_height="wrap_content" android:id="@+id/ScrollView1"&gt; &lt;RelativeLayout android:layout_height="wrap_content" android:id="@+id/RelativeLayout1"&gt; &lt;EditView android:id="@+id/EditView1&gt; &lt;/EditView&gt; &lt;ListView android:id="@+id/ListView1 android:layout_height="wrap_content" android:layout_below="@id/EditView1&gt; android:divider="#b5b5b5" android:dividerHeight="1dp" /&gt; </code></pre> <p>I then use a custom BaseAdapter to fill data into the ListView</p> <pre><code>listView = (ListView) findViewById(R.id.ListView1); dbRecords = db.getAllRecordsByRecordId(recordId); CBA_Records adapter = new CBA_Records(this, dbRecords); listView.setAdapter(adapter); </code></pre> <p>This is all the same stuff that I've done before, except this is all wrapped inside the scrollview. The reason for this is that there might be more fields than will fit on a smaller screen (or horizontal screen), so the screen must be scrollable. And, the listview must also be there ... </p> <p>Any suggestions?</p>
    singulars
    1. This table or related slice is empty.
    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.
    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