Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>ListViews do not go in ScrollViews.</strong></p> <p>ListView is for displaying a limited window into unbounded content efficiently. If you were to "disable scrolling" on a ListView to put it within a ScrollView you lose all practical reason for using a ListView in the first place.</p> <p>If you want to use a ListView to show lots of content or unbounded content but also have content above and below that scrolls with it, add header or footer views to the ListView using <a href="http://developer.android.com/reference/android/widget/ListView.html#addHeaderView(android.view.View)" rel="noreferrer"><code>addHeaderView</code></a> or <a href="http://developer.android.com/reference/android/widget/ListView.html#addFooterView(android.view.View)" rel="noreferrer"><code>addFooterView</code></a>. If the list content is going to be a small portion of your overall layout as you describe, this probably isn't the best approach for you.</p> <p>If you have a <strong>small, bounded</strong> set of content to present, go ahead and use a ScrollView and programmatically generate child views for your "list items" where appropriate.</p> <p>A common pattern used in the framework to mix inflated XML content with programmatically generated content is to add a placeholder view in the layout XML, usually a <code>LinearLayout</code> or <code>FrameLayout</code>. Use <code>findViewById</code> to locate it at runtime and add generated child views to it.</p> <p>You could even still use a <code>ListAdapter</code> with this approach if you have one written already, just call <code>content.addView(adapter.getView(position, null, content))</code> in a loop for all adapter positions (where <code>content</code> is the placeholder view you located with <code>findViewById</code>). Note that this is only practical if you know that you have a small number of list items in the adapter!</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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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