Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9099] Android: left/right padding not working with layout:horizontal

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-07-10T23:51:45.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sRelease 2.1.0
ComponentsAndroid
Labelscommunity, core, module_view, qe-testadded
ReporterShannon Hicks
AssigneeNeeraj Gupta
Created2012-05-03T11:27:06.000+0000
Updated2012-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

FileDateSize
Screenshot 1.png2012-05-10T13:08:15.000+000023257
Screenshot 2.png2012-05-10T13:08:15.000+000022474
TIMOB-9099.png2012-06-23T11:47:17.000+0000223514

Comments

  1. Max Stepanov 2012-05-30

    Cannot reproduce with master builds (05/30/12).
  2. Neeraj Gupta 2012-05-30

    Fixed as part of composite layout enhancements.
  3. Smitha Guduru 2012-06-23

    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)
  4. Eric Merriman 2012-06-23

    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)?
  5. Max Stepanov 2012-06-23

    Eric, compare to iOS/MobileWeb.
  6. Eric Merriman 2012-06-25

    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.
  7. Neha Chhabra 2012-07-10

    Reopening to update labels.

JSON Source