Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7562] iOS: Titanium.UI.View: view with layout property set to horizontal or vertical does not display children

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-04-18T17:33:32.000+0000
Affected Version/sRelease 1.7.2, Release 1.7.3, Release 1.7.4, Release 1.7.5, Release 1.8.0.1, Release 2.0.0, Release 1.8.1
Fix Version/sRelease 2.0.0, Sprint 2012-06
ComponentsiOS
Labelsmodule_view, parity, qe-testadded
ReporterDustin Hyde
AssigneeVishal Duggal
Created2012-02-06T18:27:26.000+0000
Updated2012-11-19T19:07:46.000+0000

Description

When the layout property of a View is set to 'vertical' or 'horizontal', children do not display. Works on Android. Tested on Views and Windows using Labels, TextFields, and Buttons. Steps to Reproduce: 1. Run Code:
var win = Ti.UI.createWindow({
	backgroundColor:'red',
	layout:'horizontal'
});

var left = Ti.UI.createLabel({
	title:'Left',
	backgroundColor:'blue',
	color:'black',
	width:'50%',
	height:'100%'
});

var right = Ti.UI.createLabel({
	title:'Right',
	backgroundColor:'green',
	color:'black',
	width:'50%',
	height:'100%'
});

win.add(left);
win.add(right);

win.open();
Expected Result: There should be a blue bar and a green bar (two labels in a horizontal layout). Screenshot attached. Actual Result: Red background (only the window background). Screenshot attached.

Attachments

FileDateSize
Android.png2012-02-06T18:27:26.000+000018813
iOS_current.png2012-03-12T09:43:48.000+00008637
iOS.png2012-02-06T18:27:26.000+00006900

Comments

  1. Dustin Hyde 2012-02-08

    May be related to the use of percentage values.
  2. Dustin Hyde 2012-02-08

    The work-around is to use an 'absolute' (default) layout with percentages relative to the boundaries (top, bottom, left, right).
  3. Wilson Luu 2012-03-15

    Closing bug. Verified fix on: SDK build: 2.0.0.v20120315140247 Titanium Studio, build: 2.0.0.201203142055 xcode: 4.2 Device: iphone 4s (5.0.1)
  4. Michael Pettiford 2012-04-18

    reopening/closing to add/remove labels

JSON Source