Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9338] iOS: Picker inside ScrollView is not working in iOS 4.3

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2012-06-06T17:12:00.000+0000
Affected Version/sRelease 2.1.0, Release 1.8.2, Release 2.0.1
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterDavide Cassenti
AssigneeNeeraj Gupta
Created2012-06-01T08:58:22.000+0000
Updated2014-06-19T12:43:43.000+0000

Description

Problem description

When creating a Picker inside a ScrollView in iOS 4.3, the picker does not scroll, but the ScrollView does instead. The same code works with iOS 5+

Steps to reproduce

1. create an app with the code below 2. run the app with iOS 4.3 2. scroll the picker 3. the picker does not scroll, but the scrollview does, instead

var win = Titanium.UI.createWindow({
    backgroundColor:'#fff'
});

var scrollView = Ti.UI.createScrollView({
  contentWidth: 'auto',
  contentHeight: 'auto',
  showVerticalScrollIndicator: true,
  showHorizontalScrollIndicator: true
});

var view = Ti.UI.createView({
  backgroundColor:'#336699',
  height: 2000,
  width: 250
});

var picker = Ti.UI.createPicker({
    top: 0
});

var data = [];
data[0]=Ti.UI.createPickerRow({title:'Bananas'});
data[1]=Ti.UI.createPickerRow({title:'Strawberries'});
data[2]=Ti.UI.createPickerRow({title:'Mangos'});
data[3]=Ti.UI.createPickerRow({title:'Grapes'});

picker.add(data);
picker.selectionIndicator = true;

view.add(picker);
scrollView.add(view);

win.add(scrollView);

win.open();

Expected result

Picker should work and the view should not scroll

Additional notes

Customer ticket: http://support-admin.appcelerator.com/display/17325

Comments

  1. Pedro Enrique 2012-06-06

    This is not a bug in Titanium, this is the cause of placing two scrolling components together. The reason it works differently is due to the iOS version and how the framework works internally.

JSON Source