Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4404] iOS: UI.Label - label fills entire view space rather than auto-sizing to text

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-03-20T13:40:13.000+0000
Affected Version/sRelease 1.7.0
Fix Version/sRelease 2.0.0, Sprint 2012-06
ComponentsiOS
Labelsparity
ReporterNatalie Huynh
AssigneeNeeraj Gupta
Created2011-06-14T11:15:34.000+0000
Updated2012-03-21T11:14:36.000+0000

Description

Actual Result:

The label is filling the entire parent view space

Expected Result:

Should auto size to content

Test case

var win = Ti.UI.createWindow({
	backgroundColor: 'white',
	fullscreen: false
});

var bigNumber = 324;
var label = Ti.UI.createLabel({
	backgroundColor:'green',
	text: bigNumber,
	textAlign: 'center'
});

win.add(label);
win.open();

Test case 2

Run test 1065 from http://wiki.appcelerator.org/display/tp/UI+Composite+Layout+Behavior+Test+Case

Comments

  1. Vishal Duggal 2012-03-20

    Fixed as part of composite layout implementation
  2. Natalie Huynh 2012-03-21

    Tested with 2.0.0.v20120321071752 on Motorola Xoom (4.0.2) and iPhone 4 (4.3.5)

JSON Source