Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5281] iOS: ScrollableView dropping views (w/ more than three views)

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Do
Resolution Date2020-01-09T19:23:23.000+0000
Affected Version/sRelease 1.7.2, Release 2.1.0, Release 3.1.0, Release 3.2.0
Fix Version/sn/a
ComponentsiOS
Labelsapi, supportTeam
ReporterEduardo Gomez
AssigneeEric Merriman
Created2011-09-13T10:48:12.000+0000
Updated2020-01-09T19:23:24.000+0000

Description

Problem

When a fourth picker is added to a view; when scrolling to the fourth view and getting back to the second view, the picker rows reset to the default.

Tested on

Simulator iOS 4.3 & iPad 1 OS 4.3.2

Titanium SDKs

With SDK 1.7.x, CI Builds 1.8.x picker rows reset With SDK 1.6.2 it doesn't changes picker rows - as expected

Reproduction steps

{noformat} 1.) Set the first picker on "Mangos" then scroll, 2.) Set the second picker on "Mangos" then scroll, (or any other option it does not matter at all). 3.) Set the third picker on "Mangos" then scroll to the fourth picker, 4.) Go back to the second, and you will see that the picker is reset to default. {noformat}

Repro sequence - Pickers added to Views, Views added to a ScrollableView

// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');

// create tab group
var tabGroup = Titanium.UI.createTabGroup();

//
// create base UI tab and root window
//
var win1 = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'#fff'
});

var picker0 = Ti.UI.createPicker();
var picker1 = Ti.UI.createPicker();
var picker2 = Ti.UI.createPicker();
var picker3 = Ti.UI.createPicker();
var picker4 = Ti.UI.createPicker();


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

picker0.add(data);
picker1.add(data);
picker2.add(data);
picker3.add(data);
picker4.add(data);

var vpicker0 = Titanium.UI.createView({backgroundColor:'#123'});vpicker0.add(picker0);
var vpicker1 = Titanium.UI.createView({backgroundColor:'#123'});vpicker1.add(picker1);
var vpicker2 = Titanium.UI.createView({backgroundColor:'#123'});vpicker2.add(picker2);
var vpicker3 = Titanium.UI.createView({backgroundColor:'#123'});vpicker3.add(picker3);
var vpicker4 = Titanium.UI.createView({backgroundColor:'#123'});vpicker4.add(picker4);

var scrollView = Titanium.UI.createScrollableView({
	views:[vpicker0,vpicker1,vpicker2,vpicker3,vpicker4],
	showPagingControl:true,
	pagingControlHeight:30,
	maxZoomScale:2.0,
	currentPage:1
});

win1.add(scrollView);

var tab1 = Titanium.UI.createTab({  
    icon:'KS_nav_views.png',
    title:'Tab 1',
    window:win1
});

var label1 = Titanium.UI.createLabel({
	color:'#999',
	text:'I am Window 1',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	width:'auto'
});

win1.add(label1);

//
// create controls tab and root window
//
var win2 = Titanium.UI.createWindow({  
    title:'Tab 2',
    backgroundColor:'#fff'
});
var tab2 = Titanium.UI.createTab({  
    icon:'KS_nav_ui.png',
    title:'Tab 2',
    window:win2
});

var label2 = Titanium.UI.createLabel({
	color:'#999',
	text:'I am Window 2',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	width:'auto'
});

win2.add(label2);

//
//  add tabs
//
tabGroup.addTab(tab1);  
tabGroup.addTab(tab2);  

// open tab group
tabGroup.open();

Repro sequence - Pickers added directly to a ScrollableView

// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');

// create tab group
var tabGroup = Titanium.UI.createTabGroup();


//
// create base UI tab and root window
//
var win1 = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'#fff'
});


var picker0 = Ti.UI.createPicker();
var picker1 = Ti.UI.createPicker();
var picker2 = Ti.UI.createPicker();
var picker3 = Ti.UI.createPicker();
var picker4 = Ti.UI.createPicker();


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

// turn on the selection indicator (off by default

picker0.add(data);
picker1.add(data);
picker2.add(data);
picker3.add(data);
picker4.add(data);

var scrollView = Titanium.UI.createScrollableView({
	views:[picker0,picker1,picker2,picker3,picker4],
	showPagingControl:true,
	pagingControlHeight:30,
	maxZoomScale:2.0,
	currentPage:1
});

win1.add(scrollView);


var tab1 = Titanium.UI.createTab({  
    icon:'KS_nav_views.png',
    title:'Tab 1',
    window:win1
});

var label1 = Titanium.UI.createLabel({
	color:'#999',
	text:'I am Window 1',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	width:'auto'
});

win1.add(label1);

//
// create controls tab and root window
//
var win2 = Titanium.UI.createWindow({  
    title:'Tab 2',
    backgroundColor:'#fff'
});
var tab2 = Titanium.UI.createTab({  
    icon:'KS_nav_ui.png',
    title:'Tab 2',
    window:win2
});

var label2 = Titanium.UI.createLabel({
	color:'#999',
	text:'I am Window 2',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	width:'auto'
});

win2.add(label2);



//
//  add tabs
//
tabGroup.addTab(tab1);  
tabGroup.addTab(tab2);  


// open tab group
tabGroup.open();

Associated HD ticket

http://appc.me/c/APP-182462

Comments

  1. Junaid Younus 2012-07-12

    Tested both examples on the iOS simulator on 2.1GA, issue still reproducible.
  2. jithinpv 2013-05-09

    issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 iOS iPhone Simulator: iOS SDK version: 6.0
  3. Alan Hutton 2020-01-09

    It has been decided that this issue should be closed as “Won’t do.” This issue is out of date with our current supported SDK release (7.5.2.GA as of the date of closure), and out of date with mobile OS versions. Updating, or creating code may not reproduce the issue reported, or be a valid test case. If community members feel that the issue is still valid, please create a new ticket. Please reference this closed ticket number, include SDK used, comments, and code that demonstrates/reproduces the issue.

JSON Source