Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12434] Android: T.UI.FILL not used correctly with 'horizontal' layout

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2013-03-13T17:03:42.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.0.2
ComponentsAndroid
Labelsmodule_views, qe-closed-3.3.0, qe-testadded
ReporterMartin Guillon
AssigneeShameer Jan
Created2012-12-27T17:22:37.000+0000
Updated2014-07-01T10:31:35.000+0000

Description

In this example with an horizontal layout, Ti.UI.FILL is not used correctly. I have tried to look at the TiCompositeLayout, but I couldn't really find my way in it. This works, you will see the text of the label:
var win = Titanium.UI.createWindow();
win.backgroundColor = '#ccc';

var view1 = Ti.UI.createView({
	width : 400,
	backgroundColor : 'red',
	height : 40

})

var view2 = Ti.UI.createView({
	width : 100,
	backgroundColor : 'green',
	left : 0
})
var view3 = Ti.UI.createLabel({
	width : Ti.UI.FILL,
	textAlign : 'right',
	text : 'TestLayout',
	backgroundColor : 'blue',
	left : 100
})

view1.add(view2);
view1.add(view3);
win.add(view1);
win.open();
Now with the horizontal layout it doesn't work:
var win = Titanium.UI.createWindow();
win.backgroundColor = '#ccc';

var view1 = Ti.UI.createView({
	width : 400,
	backgroundColor : 'red',
	layout : 'horizontal',
	horizontalWrap : false,
	height : 40

})

var view2 = Ti.UI.createView({
	width : 100,
	backgroundColor : 'green',
	left : 0
})
var view3 = Ti.UI.createLabel({
	width : Ti.UI.FILL,
	textAlign : 'right',
	text : 'TestLayout',
	backgroundColor : 'blue',
	left : 0
})

view1.add(view2);
view1.add(view3);
win.add(view1);
win.open();

Comments

  1. Shameer Jan 2013-03-13

    The problem cannot reproduce with release 3.0.2
  2. Priya Agarwal 2014-07-01

    Verified with: Appcelerator-Studio:3.3.0.201406271159 Sdk:3.3.0.v20140627202512 acs:1.0.14 alloy:1.4.0-rc3 npm:1.3.2 titanium:3.3.0-rc4 titanium-code-processor:1.1.1 xcode:5.1.1 OS:Maverick(10.9.3) Device:iPhone5c(v7.1.1),LG-P970(v4.0.4) Horizontal layout working fine inside views. Hence closing the issue

JSON Source