Skip to content

Instantly share code, notes, and snippets.

@MotiurRahman
Created March 22, 2019 13:01
Show Gist options
  • Select an option

  • Save MotiurRahman/56dec245d839879f01ff5b15dbf94106 to your computer and use it in GitHub Desktop.

Select an option

Save MotiurRahman/56dec245d839879f01ff5b15dbf94106 to your computer and use it in GitHub Desktop.
selectionstyle example
var win = Ti.UI.createWindow({ backgroundColor: 'white' });
var data = [{
properties: {
title: 'Title',
subtitle: 'Subtitle',
image: 'KS_nav_views.png', // not used by this template
accessoryType: Ti.UI.LIST_ACCESSORY_TYPE_NONE,
selectionStyle: Titanium.UI.iOS.ListViewCellSelectionStyle.BLUE
},
template: Ti.UI.LIST_ITEM_TEMPLATE_CONTACTS
},
{
properties: {
title: 'Title',
subtitle: 'Subtitle',
image: 'KS_nav_views.png',
accessoryType: Ti.UI.LIST_ACCESSORY_TYPE_CHECKMARK,
selectionStyle: Titanium.UI.iOS.ListViewCellSelectionStyle.BLUE
},
template: Ti.UI.LIST_ITEM_TEMPLATE_SETTINGS
},
{
properties: {
title: 'Title',
subtitle: 'Subtitle',
image: 'KS_nav_views.png',
accessoryType: Ti.UI.LIST_ACCESSORY_TYPE_DETAIL,
selectionStyle: Titanium.UI.iOS.ListViewCellSelectionStyle.BLUE
},
template: Ti.UI.LIST_ITEM_TEMPLATE_SUBTITLE
},
{
properties: {
title: 'Title',
subtitle: 'Subtitle', // not used by this template
image: 'KS_nav_views.png',
accessoryType: Ti.UI.LIST_ACCESSORY_TYPE_DISCLOSURE,
selectionStyle: Titanium.UI.iOS.ListViewCellSelectionStyle.BLUE
},
template: Ti.UI.LIST_ITEM_TEMPLATE_DEFAULT
}
];
var listSection = Ti.UI.createListSection({ items: data });
var listView = Ti.UI.createListView({ sections: [listSection] });
win.add(listView);
win.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment