1. Run code below
2. Click the picker
Titanium.UI.setBackgroundColor('#000');
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
var win5 = Titanium.UI.createScrollView({
contentHeight:'auto',
left:15,
right:5
,layout:'vertical'
});
var names = ['Joanie', 'Mickey', 'Jean-Pierre', 'Gustav', 'Raul', 'Mimi', 'Emily', 'Sandra', 'Carrie', 'Chachi'];
var verbs = ['loves', 'likes', 'visits', 'loathes', 'waves to', 'babysits', 'accompanies', 'teaches', 'announces', 'supports', 'knows', 'high-fives'];
var rows1 = [];
for (var i = 0; i < names.length; i++) {
rows1.push(Ti.UI.createPickerRow({title: names[i]}));
}
var rows2 = [];
for (i = 0; i < verbs.length; i++) {
rows2.push(Ti.UI.createPickerRow({title: verbs[i]}));
}
var rows3 = [];
for (i = (names.length -1); i >=0; i--) {
rows3.push(Ti.UI.createPickerRow({title: names[i]}));
}
var column1 = Ti.UI.createPickerColumn( {
rows: rows1, font: {fontSize: "12"}
});
var column2 = Ti.UI.createPickerColumn( {
rows: rows2, font: {fontSize: "12"}
});
var column3 = Ti.UI.createPickerColumn( {
rows: rows3, font: {fontSize: "12"}
});
var picker = Ti.UI.createPicker({
useSpinner: true, visibleItems: 7,
type : Ti.UI.PICKER_TYPE_PLAIN,
top: 20, height: '200',
columns: [ column1, column2, column3 ]
});
picker.addEventListener('change', function(e) {
Ti.API.info(e.selectedValue[0] + " " + e.selectedValue[1] + " " + e.selectedValue[2]);
});
win5.add(picker);
win1.add(win5);
win1.open();
Still not working in 2.0.0.GA. Drop the following into a standard new project. Picker shows up, but clicking does not display its options dialog box. The spinner style picker works fine.
A PR with the workaround - increase scrollview sensitivity, is pending. The issue is that we're not getting touch events in certain area of the picker when it is put inside the scrollview. This could be a deep layout bug or a bug in WheelView's implementation. A deeper analysis will be looked at later.
Fixed by PR 2043
Picker in scrollView is working. Verified on Titanium Studio, build: 2.2.0.201206222035 Titanium SDK: 2.1.0.v20120622174154 Device:Xoom(4.0.3)