List
March 4, 2015 ยท View on GitHub
Overview
The list control provides an easy way of showing larger amounts of data.
<layout>
<list>
<item text="item 1" />
<item text="item 2" />
<item text="item 3" />
...
</list>
</layout>
Properties
id
Set the ID for this control so that it can be updated later. See layout library.
<list id="my_toggle">
...
</list>
visibility
Set the visibility state using visible or invisible or gone.
<list visibility="gone">
...
</list>
text
Set the text to be shown in an item.
<list>
<item text="foo" />
<item text="bar" />
</list>
Items can also show sub-text using the \n delimiter.
<list>
<item text="foo\nbar" />
<item text="hello\nworld" />
</list>
icon
Set the icon to be shown in an item. See icons list of available icons.
<list>
<item icon="select" text="foo" />
<item icon="select" text="bar" />
</list>
image
Set a custom image to be shown in an item. Should be a path relative to the layout file.
<list>
<item image="img.png" text="foo" />
<item image="img.png" text="bar" />
</list>
Events
ontap
Occurs when an item is tapped.
<list ontap="tapped">
...
</list>
actions.tapped = function (index)
...
end
onhold
Occurs when an item is held down.
<list onhold="held">
...
</list>
actions.held = function (index)
...
end