Steps to reproduce
var window = Ti.UI.createWindow({
backgroundColor: 'green'
});
var tableView = Ti.UI.createTableView({
bottom: 50,
});
var row = Ti.UI.createTableViewRow({
height: Ti.UI.SIZE,
backgroundColor: 'blue',
layout: 'vertical'
});
var someView = Ti.UI.createView({
height: 50,
backgroundColor: 'purple'
});
var innerContainer = Ti.UI.createView({
height: 50,
backgroundColor: 'yellow',
isVisible: false
});
row.add(someView);
row.add(innerContainer);
tableView.appendRow(row);
var button = Ti.UI.createView({
height: 50,
width: 50,
bottom: 0,
backgroundColor: 'red'
});
window.add(tableView);
window.add(button);
button.addEventListener('click', function() {
if(innerContainer.isVisible) {
innerContainer.height = 50;
} else {
innerContainer.height = 100;
};
innerContainer.isVisible = !innerContainer.isVisible;
});
window.open();
Actual result:
TableViewRow does not update it's height when children changes height. It does change height if children is removed and added again.
button.addEventListener('click', function() {
if(innerContainer.isVisible) {
innerContainer.height = 50;
} else {
innerContainer.height = 100;
};
row.remove(innerContainer);
row.add(innerContainer);
innerContainer.isVisible = !innerContainer.isVisible;
});
Expected result:
Removing and adding again inner view is not always possible and may be resource demanding.
TableViewRow with height Ti.UI.SIZE should update its height if children changes height.
No comments