Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20509] TableViewRow with height: Ti.UI.SIZE does not update it height on children height change

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 5.2.0
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterCREATIVE KAIZEN
AssigneeUnknown
Created2016-03-03T11:37:12.000+0000
Updated2018-02-28T19:55:02.000+0000

Description

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.

Comments

No comments

JSON Source