Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6134] iOS: jittery labels when re-setting tableview data

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-11-11T09:51:22.000+0000
Affected Version/sRelease 1.8.0
Fix Version/sSprint 2011-45, Release 1.8.0.1
ComponentsiOS
Labelsmodule_tableview, qe-testadded, regression
ReporterKarol Pomaski
AssigneeStephen Tramer
Created2011-11-09T07:05:47.000+0000
Updated2011-11-22T12:34:17.000+0000

Description

Problem

While re-setting the table content with setData() method the labels that are inside the rows start jittering.

REGRESSION - works fine with SDK 1.7.5

Reproducible Steps

1. Run the sample code 2. Press the "Tap this row" row

Sample Code

var win = Ti.UI.createWindow();

var labelsLeft = ["Label","Tap this row", "Single journey", "Label", "Label", "Label", "Label"];
var labelsRight = ["One","Yes", "No", "N/A", "N/A", "N/A", "N/A"];
var rowsHeader = [true,false,true,false,true,false,false];

var data = [];

for(var i=0; i<labelsLeft.length; i++) {
		  var lbl = Ti.UI.createLabel({top:0, left:0, width: 'auto', height:50, text: labelsLeft[i]});
		  var lbl2 = Ti.UI.createLabel({top:0,right: 70, width: 'auto', height:50, text: labelsRight[i]});
		  
		  if(rowsHeader[i]) var row = Titanium.UI.createTableViewRow({header: ''});
  		  else var row = Titanium.UI.createTableViewRow();
		  
		
		  row.height = 'auto';
		  row.add(lbl);
		  row.add(lbl2);
		  
		  data.push(row);
}



var table = Titanium.UI.createTableView({top:0, style: Ti.UI.iPhone.TableViewStyle.GROUPED, data:data});

data[1].addEventListener("click",function(e){
	 if(labelsRight[2]=="No")  labelsRight[2]="Yes";
	 else labelsRight[2]="No";
	 var lbl = Ti.UI.createLabel({top:0, left:0, width: 'auto', height:50, text: labelsLeft[2]});
		  var lbl2 = Ti.UI.createLabel({top:0,right: 70, width: 'auto', height:50, text: labelsRight[2]});
		  
		  if(rowsHeader[2]) var row = Titanium.UI.createTableViewRow({header: ''});
  		  else var row = Titanium.UI.createTableViewRow();
		  
		
		  row.height = 'auto';
		  row.add(lbl);
		  row.add(lbl2);
	data[2] = row;
	
	table.setData(data);
	
});

win.add(table);
		
win.open();

Associated HelpDesk Ticket

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

Comments

  1. Stephen Tramer 2011-11-09

    This is resolved by the fix for TIMOB-5441, and should be processed along with it. Time is logged against that ticket, aside from the test to confirm.
  2. Alan Vaghti 2011-11-22

    Verified fix with 1.8.0.1.v20111122105459 on an iPod 4.3.3.

JSON Source