[TIMOB-16051] Titanium.UI.ListItem.accessoryView
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | n/a |
Status | Reopened |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | TiAPI |
Labels | accessoryview, ios, listview, listviewitem |
Reporter | Tristan Roscoe |
Assignee | Unknown |
Created | 2013-09-11T20:28:38.000+0000 |
Updated | 2018-02-28T20:03:53.000+0000 |
Description
Potential use case
var win = Ti.UI.createWindow({backgroundColor: 'white'});
var basicSwitch = Ti.UI.createSwitch({
value:true
});
basicSwitch.addEventListener('change',function(e){
Ti.API.info('Switch value: ' + basicSwitch.value);
});
var data = [
{
properties: {
title: 'Title',
image: 'KS_nav_views.png', // not used by this template
accessoryView: basicSwitch
},
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();
Potential Alloy XML Markup
<Alloy>
<Window backgroundColor="white">
<ListView id="listView">
<ListSection>
<ListItem title="Airplane Mode">
<AccessoryView>
<Switch id="basicSwitch" value="true" onChange="outputState"/>
</AccessoryView>
</ListItem>
<ListItem title="Wi-Fi"/>
<ListItem title="Bluetooth"/>
</ListSection>
</ListView>
</Window>
</Alloy>
Attachments
File | Date | Size |
---|---|---|
photo.PNG | 2013-09-11T20:28:38.000+0000 | 69949 |
Hello, Can you add more details? What you want to add as new features? Thanks
It is saying that the List Item in side the list view show have default property to add Switch as list type as it is available in attached screenshot for Airplane mode. Right now we have subview (>) checkmark (Right sine), etc.
This is a valid feature request so moving it to engineering. Titanium.UI.ListItem.accessoryType currently supports one of the following: Titanium.UI.LIST_ACCESSORY_TYPE_CHECKMARK Titanium.UI.LIST_ACCESSORY_TYPE_DETAIL Titanium.UI.LIST_ACCESSORY_TYPE_DISCLOSURE Titanium.UI.LIST_ACCESSORY_TYPE_NONE (Default) This is a feature request to add Titanium.UI.LIST_ACCESSORY_TYPE_SWITCH to implement the functionality similar to airplane mode on most phones.