[TIMOB-9099] Android: left/right padding not working with layout:horizontal
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-07-10T23:51:45.000+0000 |
Affected Version/s | Release 2.1.0 |
Fix Version/s | Release 2.1.0 |
Components | Android |
Labels | community, core, module_view, qe-testadded |
Reporter | Shannon Hicks |
Assignee | Neeraj Gupta |
Created | 2012-05-03T11:27:06.000+0000 |
Updated | 2012-07-11T14:43:59.000+0000 |
Description
When a container has layout:'horizontal' specified, the left/right values of children seem to be ignored, when they should produce padding:
var win = Ti.UI.createWindow();
var container = Ti.UI.createView({
layout:'horizontal',
width:200,
height:28,
backgroundColor:'#fff',
borderColor:'#000',
borderWidth:1,
});
var child1 = Ti.UI.createView({
backgroundColor:'#f00',
height:20,
width:20,
left:10,
right:10,
});
container.add(child1);
var child2 = Ti.UI.createView({
backgroundColor:'#0f0',
height:20,
width:20,
left:10,
right:10,
});
container.add(child2);
win.add(container);
win.open();
Screenshot 1 shows the output without using the layout property and Screenshot 2 shows the result of using the layout property
Attachments
File | Date | Size |
---|---|---|
Screenshot 1.png | 2012-05-10T13:08:15.000+0000 | 23257 |
Screenshot 2.png | 2012-05-10T13:08:15.000+0000 | 22474 |
TIMOB-9099.png | 2012-06-23T11:47:17.000+0000 | 223514 |
Cannot reproduce with master builds (05/30/12).
Fixed as part of composite layout enhancements.
Attached "TIMOB-9099" is the new screenshot on the following environment Titanium Studio, build: 2.2.0.201206222035 Titanium SDK: 2.1.0.v20120622174154 Device:Xoom(4.0.3)
Two things to note: first, are the attached screenshots accurate? They don't seem to match the text. Varun? Second, please see attached screenshot showing 2.1.0 behavior, is this expected (the lack of padding at between the top of the container and the two child views)?
Eric, compare to iOS/MobileWeb.
After discussing with the team, the result as seen in the last attachment is expected. The horizontal layout with both children having left and right of 10 results in 10, child 1, 20, child 2, 10. The lack of buffer at the top of the container view is also expected. This behavior is identical on iOS and Android. Closing as fixed with SDK 2.1.0.v20120621224153.
Reopening to update labels.