ListView

A view that shows items in a vertically or horizontally scrolling list using View Templates.

Examples

Setting the maximum collapsed lines
<ListView width="fill_parent" height="fill_parent" items="#{listItems}"
	onItemClicked="#{onItemClicked(index)}">
	<Template>
		<TextView text="#{item}" width="fill_parent" height="48dp"
			textHorizontalAlign="center" textVerticalAlign="center" fontSize="16" />
	</Template>
</ListView>

Children

One or more Template elements. Please refer to the View Templates documentation.

Attributes

Name Type Default Binding Description

Inherits all attributes from View and adds the following:

items

expressionType

output

Binding to the objects that shall be listed.

itemVar

name

"item"

Optionally you can change the name of the item’s variable to be used in the template expressions.

onItemClicked

expressionType

action

Action binding for for the item click action. You can use "item" or "index" as parameter in the expression as you like. E.g: #{myFunction(item)} or #{myFunction(index)}

orientation

enum

vertical

Defines the scrolling direction of the list. Can be either vertical or (guess what) horizontal.

scrollable

boolean

true

If yo use a ListView within a ScrollView (because you need Header of Footer), you can disable scrolling and let the ScrollView handle scroll events instead.

showScrollBar

boolean

true

Allows disabling the scrollbar, e.g. for horizontally scrolling lists.


Parts of this documentation are a derivate of the Android Developer Documentation by Google used under CC-BY-2.5.

results matching ""

    No results matching ""