Property
The [Titanium.UI.PickerRow.selected](
http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.PickerRow.selected-property.html) property does not currently work for either iOS or Android, despite being used in the KitchenSink. Thus, determine the future of this property, and raise platform tickets to address the issues if necessary.
As a workaround, use the picker method, [Titanium.UI.Picker.setSelectedRow](
http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.Picker.setSelectedRow-method.html).
Test Case
Ti.UI.backgroundColor = 'white';
var win = Ti.UI.createWindow({
exitOnClose: true,
layout: 'vertical'
});
var picker = Ti.UI.createPicker({
top:50
});
var data = [];
data[0]=Ti.UI.createPickerRow({title:'Bananas'});
data[1]=Ti.UI.createPickerRow({title:'Strawberries', selected: true}); // selected property does not work
data[2]=Ti.UI.createPickerRow({title:'Mangos'});
data[3]=Ti.UI.createPickerRow({title:'Grapes'});
picker.add(data);
picker.selectionIndicator = true;
win.add(picker);
win.open();
// picker.setSelectedRow(0, 2, false); // uncomment to test on Android. This must be wrapped in setTimeout() on iOS, as it won't take effect unless the picker has been rendered
Resolving ticket as Invalid as there is now a new version of Kitchen Sink available and we no longer support the version which relates to this ticket.