Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8469] Android: Picker in scrollableView not working

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionDuplicate
Resolution Date2012-04-01T11:40:49.000+0000
Affected Version/sRelease 1.8.2
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterChristian Brousseau
AssigneeShak Hossain
Created2012-03-01T10:22:05.000+0000
Updated2012-04-01T12:28:33.000+0000

Description

Issue

Picker in scrollableView not working.

Tested on

Android Emulator 2.2 Droid Razr 2.3.5

Runtime Engines

Rhino / V8

Steps to reproduce

1. Run code below 2. Click the picker

Expected behavior

See fully operational Pickers whose options render on screen

Repro sequence

var self = Ti.UI.createWindow({
	fullscreen : true
});
var vw = Ti.UI.createView({
	width : '100%',
	height : '100%'
});
var picker = Ti.UI.createPicker({
});

for(var i = 0; i <= 10; i++) {
	picker.add(Ti.UI.createPickerRow({
		title : 'Item ' + i
	}));
}

vw.add(picker);

var views = [];
views.push(vw);

var scroll = Ti.UI.createScrollableView({
	width : '100%',
	height : '100%',
	views : views
});

self.add(scroll);//it won't work with this
//self.add(vw);//uncomment  this to get it working on a view

self.open();

Comments

  1. Hani Hamadeh 2012-03-08

    same problem with ScrollView
       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();
       
  2. Hani Hamadeh 2012-03-08

    problem: the picker does not function.
  3. Eduardo Gomez 2012-03-31

    Hani Hamadeh The Picker in scrollView not working is filed here: TIMOB-8470 Next time please create a separate Jira ticket, thanks.
  4. Shak Hossain 2012-04-01

    Duplicate of timob-8470

JSON Source