Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8548] iOS - Console warning of height of label inside a table view row

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-04-02T11:16:39.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sRelease 3.0.2
ComponentsiOS
Labelsn/a
ReporterPedro Enrique
Assigneejithinpv
Created2012-04-05T06:32:26.000+0000
Updated2017-03-21T21:28:42.000+0000

Description

Description:

Adding a label to a tableview row gives a console warning about the layout of the label and the row _if_ the label has a margin.

Sample code:

var win = Ti.UI.createWindow({
	backgroundColor:'#ccc'
});

var table = Ti.UI.createTableView({
	rowHeight:44	
});

var row = Ti.UI.createTableViewRow();

var label = Ti.UI.createLabel({
	text:'Hello World',
	width:Ti.UI.SIZE,
	height:Ti.UI.SIZE,
	backgroundColor:'white',
	left:20 // removing the left property will make the warnings go away
})

row.add(label);

table.setData([row]);

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

Console warnings:

[WARN] [object TiUILabel] has an auto height value of 0, meaning this view may not be visible.

[WARN] [object TiUITableViewRow] has an auto height value of 0, meaning this view may not be visible.

Comments

  1. Javier Rayon 2012-06-19

    A workaround for this is to disable this output directly modifying the titanium SDK. For anyone interested, edit file TiUIViewProxy.m in Titanium mobile sdk folder. Inside the file, you can look for the phrase "has an auto" . In Titanium 2.0.2 there are 2 coincidences in lines 689 and 782 (one for height and one for width). Comment these lines to hide the annoying message.
  2. jithinpv 2013-04-02

    Issue does not reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 iOS iPhone Simulator: iOS SDK version: 6.0
  3. Lee Morris 2017-03-21

    Closing ticket as the issue cannot be reproduced.

JSON Source