Note that there are some explanatory texts on larger screens.

plurals
  1. POListview embedded in a ExpandableListActivity is only partially displayed on the screen
    primarykey
    data
    text
    <p>I use a <code>ListView</code> as the child row in a <code>ExpandableListActivity</code> and have defined a custom <code>CursorTreeAdapter</code> for it. The values and the views are being populated by my code just as expected, but each expandable list row (<code>ListView</code> with variable number of items in it) is only partially shown (only the first 2 items are being displayed).</p> <ol> <li><p>While debugging through the code, I confirmed that all the child rows (<code>ListView</code>) are being populated properly (that is with 10-15 rows in it)</p></li> <li><p>Just to confirm further, I changed <code>android:stackFromBottom = "true"</code> for the <code>ListView</code>, this time only the last 2 items were displayed for each expandable item row.</p></li> </ol> <p>`</p> <pre><code>public class WorkExpandableListAdapter extends CursorTreeAdapter { public WorkExpandableListAdapter(Cursor cursor, Context context) { super(cursor, context, true); } protected Cursor getChildrenCursor(Cursor groupCursor) { ... return childCursor; } @Override protected void bindChildView(View view, Context context, Cursor cursor, boolean isLastChild) { if (!noColumnsToDisplay) { int numColumns = workProjection.length + 1; // to skip the _id ArrayList&lt;JXTField&gt; jxtFields = new ArrayList&lt;JXTField&gt;(); for (int i = 1; i &lt; numColumns; i++) { jxtFields.add(new JXTField(workProjection[i - 1], cursor.getString(cursor .getColumnIndex(workProjection[i - 1])))); } //OrderAdapter is simply a customized Array adapter which converts name value pairs into //customized 2 line items ArrayAdapter&lt;JXTField&gt; adapter = new OrderAdapter(WorkList.this, R.layout.work_view_row, jxtFields); ((ListView) view.findViewById(R.id.expandable_child_list)) .setAdapter(adapter); } } @Override public View newChildView(Context context, Cursor cursor, boolean isLastChild, ViewGroup parent) { return getLayoutInflater().inflate(R.layout.expandable_child_list,null); } @Override protected void bindGroupView(View view, Context context, Cursor cursor, boolean isExpanded) { ... } @Override protected View newGroupView(Context context, Cursor cursor, boolean isExpanded, ViewGroup parent) { return ((TextView) getLayoutInflater().inflate(android.R.layout.simple_expandable_list_item_1, null)); } } </code></pre> <p>`</p> <p><strong>expandable_child_list.xml</strong></p> <p>` </p> <pre><code>&lt;ListView android:id="@+id/expandable_child_listt" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingLeft="20dp" android:layout_weight="2.0" /&gt; </code></pre> <p>`</p> <p><strong>work_view_row.xml</strong> ` </p> <pre><code>&lt;LinearLayout android:orientation="vertical" android:layout_width="0dip" android:layout_weight="1" android:layout_height="fill_parent"&gt; &lt;TextView android:id="@+id/work_view_row_top_text" android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1" android:gravity="center_vertical" /&gt; &lt;TextView android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1" android:id="@+id/work_view_row_bottom_text" android:ellipsize="marquee" android:textAppearance="?android:attr/textAppearanceMedium" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>`</p> <p>This looked like an easy one to solve when I first encountered it, but after wasting too much time on it I resort to the gurus. Maybe I am missing something very obvious, but please point out. :(</p> <p>Thanks in advance.</p>
    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.
    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