Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15097] Android: Ti.UI.FILL stretches parent views beyond absolutely-sized parent

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2017-08-22T23:55:31.000+0000
Affected Version/sRelease 3.1.2
Fix Version/sRelease 6.2.0
ComponentsAndroid
Labelsparity
ReporterFokke Zandbergen
AssigneeJoshua Quick
Created2013-08-30T10:36:30.000+0000
Updated2017-08-22T23:55:55.000+0000

Description

The following code has a different result on Android then expected and correctly shown on iOS. Compare the two screenshots and see that while the blue v3 view correctly fills the height of its fixed-sized green v2 view, it causes the red v1 view to fill to its parent instead of size to its child.

Code to reproduce

var win = Ti.UI.createWindow({backgroundColor:'white'});
var v1 = Ti.UI.createView({backgroundColor:'red', width: 100, height: Ti.UI.SIZE});
var v2 = Ti.UI.createView({backgroundColor:'green', width: 100, height: 100});
var v3 = Ti.UI.createView({backgroundColor:'blue', width: 100, height: Ti.UI.FILL});
v2.add(v3);
v1.add(v2);
win.add(v1);
win.open();

Workaround

On line 4, replace Ti.UI.FILL by '100%' and it will work as expected in *most* cases. The difference is that if in the exampel above you would set v3.top: 50 and height: '100%' then the height will be 100 and not 50 as with Ti.UI.FILL!

Attachments

FileDateSize
android.png2013-08-30T10:36:30.000+000014035
ios.png2013-08-30T10:36:30.000+000016273

Comments

  1. Abir Mukherjee 2017-08-22

    Passed FR. PR merged. Changes are seen in SDK versions: 6.2.0.v20170822113609 7.0.0.v20170822142802

JSON Source