Hi,
I am using listViews to show our feed data. On iOS I include a JS file wich includes all of the template objects.
When the items are created I am referring to the right template name. Works like a charm.
Example of the file: http://pastebin.com/N3r3SAns
Then, in the controller:
// include the templates var listViewTemplate = require('ui/listViewTemplates'); // set templates listView.templates = { 'template_small' : listViewTemplate.articleTemplateSmall }; // set default listView.defaultItemTemplate = 'template_small'; ... and then setting the "template" property to "template_small" when creating the items.Problem: on Android this doesn't seem to work. I have to define the template styling in the TSS file, and the ItemTemplates structure in the view (xml, alloy), or else I get the error "No template defined".
The big disadvantage: I can't change any of the templates and styling in the controller. So If I need two templates that are 99% the same but differ on one little thing, I have to duplicate the template completely.
Any help would be appreciated!