[ALOY-608] Support ListView's ItemTemplate in markup
GitHub Issue | n/a |
---|---|
Type | Sub-task |
Priority | High |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2013-04-09T22:02:27.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 1.2.0, 2013 Sprint 08 |
Components | XML |
Labels | notable |
Reporter | Tony Lukasavage |
Assignee | Unknown |
Created | 2013-04-05T16:12:30.000+0000 |
Updated | 2018-03-07T22:25:37.000+0000 |
Description
Enable ItemTemplates to be defined and used in ListView markup. Something like this (subject to change):
<Alloy>
<Tab title="templates">
<Window title="templates">
<ListView id="list" defaultItemTemplate="template1">
<Templates>
<ItemTemplate name="template1" height="100">
<ImageView bindId="image" left="15" top="6" bottom="6"/>
<Label bindId="label" left="100" right="10"/>
</ItemTemplate>
<ItemTemplate name="template2" height="100">
<Label bindId="label"/>
</ItemTemplate>
</Templates>
<ListSection>
<ListItem image:image="appc.png" label:text="this is some text"/>
<ListItem image:image="appc.png" label:text="here we go again"/>
<ListItem template="template2" label:text="here is template2" label:textAlign="center"/>
</ListSection>
</ListView>
</Window>
</Tab>
</Alloy>
ItemTemplates are working as described in the markup. Sample code can be found in: https://github.com/appcelerator/alloy/tree/master/test/apps/ui/listview
Verified as working. Environment: Titanium SDK 3.1.2.v20130710144553 Appcelerator Studio 3.1.2.201307101037 Alloy 1.2.0