[TIMOB-8193] iOS: Composite layout - horizontal layout Views don't position children correctly
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-04-04T14:21:43.000+0000 |
Affected Version/s | Release 2.0.0 |
Fix Version/s | Release 2.0.0, Sprint 2012-06 |
Components | iOS |
Labels | module_view, parity, qe-testadded |
Reporter | Nikhil Sharma |
Assignee | Vishal Duggal |
Created | 2012-03-22T12:34:53.000+0000 |
Updated | 2012-04-04T14:21:43.000+0000 |
Description
Horizontal layout Views don't position children correctly.
Expected behavior
A red view at the top of the window (full width). An orange view occupying the left half of the red view. A blue square view immediately to the right of the orange view.Repo Steps
1.Run the below code in app.js 2.You will see the orange view actually appears centered on the red view and the blue view actually appears at position 0,0
var win1 = Ti.UI.createWindow({
title:'Win 1',
layout:'vertical',
backgroundColor:'#fff'
});
var vw1 = Ti.UI.createView({
layout:'horizontal',
backgroundColor:'red',
width:'100%',
height:75
});
win1.add(vw1);
//
var TheOrange=Ti.UI.createView({height:75,
width:'160dp',
backgroundColor:'orange',
top:0
});
var GreenView=Ti.UI.createView({
height:Ti.UI.SIZE,
width:Ti.UI.SIZE,
focusable:false,
touchEnabled:false,
backgroundColor:'green'
});
GreenView.add(TheOrange);
vw1.add(GreenView);
var BlueView=Ti.UI.createView({
backgroundColor:'blue',
width:50,
height:50
});
vw1.add(BlueView);
//
win1.open();
Attachments
File | Date | Size |
---|---|---|
expected.png | 2012-04-04T14:21:14.000+0000 | 12199 |
ios_vs_android.png | 2012-03-22T15:48:43.000+0000 | 63984 |
Note that the code works correctly on Android.
Vishal, see the attached iOS vs Android layout behavior after the fix.
Originally reported issue is fixed, but reopening due to blue box should be vertically centered within red box as on Android.
Closing bug. Verified fix on: SDK build: 2.0.0.v20120323221800 Titanium Studio, build: 2.0.0.201203240504 xcode: 4.3 Device: iphone 4s Verizon (5.0.1)
Verified fix on SDK 2.0.0.v20120325213306. Thanks!
Attaching screenshot of expected behavior.