{ "id": "91894", "key": "AC-3013", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-07-19T10:14:17.000+0000", "created": "2012-05-16T04:48:34.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:48:02.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "h2. The problem\r\n\r\nView doesn't layout child components well when \"horizontal\" layout is used and child component has margins defined via \"left\" and \"top\" properties.\r\n\r\nTo see this, run this example:\r\n\r\n{code}\r\n(function() {\r\n \r\n var win = Ti.UI.createWindow({ navBarHidden: true });\r\n \r\n var view = Ti.UI.createView({\r\n \theight: Ti.UI.FILL,\r\n \twidth: Ti.UI.FILL,\r\n \tbackgroundColor: \"#fff\",\r\n \tlayout: \"horizontal\"\r\n });\r\n \r\n for (var i = 0; i < 10; ++i) {\r\n \tview.add(Ti.UI.createLabel({ height: \"75dp\", width: Ti.UI.FILL, text: \"Label \" + i, left: 20, top: 10, backgroundColor: \"#00f\" }));\r\n }\r\n \r\n win.add(view);\r\n \r\n win.open();\r\n \r\n})();\r\n{code}\r\n\r\nYou should see that first label has top and left margin, while others do not.\r\n\r\n\r\nh2. Expected behavior\r\n\r\nAll labels should behave in same manner - they should all have top and left margins, not only the first one.", "attachment": [], "flagged": false, "summary": "Android: \"horizontal\" layout doesn't work well", "creator": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "* Titanium SDK version: 2.1.0 (05/15/12 14:33 376b4ae)\r\n* v8\r\n* Android 3.0\r\n* Thinkpad tablet\r\n* OSX Lion", "comment": { "comments": [ { "id": "197407", "author": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hello Ivan,\r\n\r\nwhy are you using the 'horizontal' layout, if your label has a witdh equals to Ti.UI.FILL? Using the 'vertical' layout, the result should be the one you are looking for: labels are placed 20px from the left and 10px from the top, and they are as large as the display; you can also test setting a fixed width for the labels (e.g. 75dp) and see that they are correctly placed in the screen (e.g. second one is 20px right the first one etc.).\r\n\r\nIsn't this the result you want to achieve? Can you explain more in detail, in case the goal is different?\r\n\r\nThank you", "updateAuthor": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-06-05T15:38:07.000+0000", "updated": "2012-06-05T15:38:07.000+0000" }, { "id": "197450", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Hello Davide.\r\n\r\n\r\nI'm trying to position label-input pairs.\r\n\r\n\r\n label1 input1\r\n \r\n label2 input2\r\n\r\n\r\nTo make that look better, I want to have left and top margin.\r\n\r\n\r\nThis issue was reported because I couldn't achieve that with \"horizontal\" layout. The test case is reduced so it represents minimal example that shows the issue.\r\n\r\n\r\nI tried to use \"vertical\" layout, but it has some other problems. :)\r\n\r\n\r\n\r\nThanks for your help.", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-06-06T00:24:38.000+0000", "updated": "2012-06-06T00:24:38.000+0000" }, { "id": "208169", "author": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Ivan,\r\n\r\nI have tried to follow all the steps you provided in order to reproduce this error you are seeing. After running the code you provided on an asus ee pad (3.2), I see no error or anything working different from how it should. Can you provide a screenshot or a more detailed explanation of what is not working \"well\"? \r\n\r\nThank you,\r\n\r\nCarter", "updateAuthor": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-17T14:46:48.000+0000", "updated": "2012-07-17T14:46:48.000+0000" }, { "id": "208244", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Hi Carter,\r\n\r\n\r\nthis issue seems to be fixed with latest CI build. Don't know what commit fixed it, but you can close it now. :)\r\n\r\n\r\n\r\nThanks.", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-07-18T00:34:44.000+0000", "updated": "2012-07-18T00:34:44.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }