[TIMOB-15097] Android: Ti.UI.FILL stretches parent views beyond absolutely-sized parent
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Low |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2017-08-22T23:55:31.000+0000 |
| Affected Version/s | Release 3.1.2 |
| Fix Version/s | Release 6.2.0 |
| Components | Android |
| Labels | parity |
| Reporter | Fokke Zandbergen |
| Assignee | Joshua Quick |
| Created | 2013-08-30T10:36:30.000+0000 |
| Updated | 2017-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, replaceTi.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
| File | Date | Size |
|---|---|---|
| android.png | 2013-08-30T10:36:30.000+0000 | 14035 |
| ios.png | 2013-08-30T10:36:30.000+0000 | 16273 |
Passed FR. PR merged. Changes are seen in SDK versions: 6.2.0.v20170822113609 7.0.0.v20170822142802