[TIMOB-1445] Updating a label in a table header view causes a layout issue
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Trivial |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2012-06-22T14:37:51.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | defect, header, ios, iphone, view |
Reporter | ctredway |
Assignee | Vishal Duggal |
Created | 2011-04-15T02:53:02.000+0000 |
Updated | 2017-03-09T22:49:40.000+0000 |
Description
A customer reported that when updating the text of a label in a header view, the headerView moves, jumping to the middle of the window. I have reproduced this as well in iOS 4 and sdk 1.4
FWIW, if the label is given a height of 35 it doesn't jump around
CODE:
var win = Ti.UI.createWindow({});
var data = [];
data[0] = Ti.UI.createTableViewRow({title:'Row 1'});
data[1] = Ti.UI.createTableViewRow({title:'Row 2'});
data[2] = Ti.UI.createTableViewRow({title:'Row 3'});
data[3] = Ti.UI.createTableViewRow({title:'Row 4'});
var headerView = Ti.UI.createView({height:'auto'});
var headerLabel = Ti.UI.createLabel({
text:'Here is some text for the header label.',
height:'auto',
left:10,
right:10
});
headerView.add(headerLabel);
var tableView = Ti.UI.createTableView({
style:Titanium.UI.iPhone.TableViewStyle.GROUPED,
top:0,
right:0,
left:0,
headerView:headerView,
data:data
});
win.add(tableView);
var button = Ti.UI.createButton({
title:'Change Header',
height:40,
width:150,
bottom:10
});
button.addEventListener('click', function()
{
headerLabel.text = 'This is some different text.';
});
win.add(button);
win.open();
Note to self: This may be due to any change in header's height requiring a reload of the section, but still possible to compensate around this.
Was this fixed in the refactor? We'll have to revisit it.
Duplicate of TIMOB-8503
Closing ticket as duplicate.