{ "id": "172969", "key": "TIMOB-26805", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2019-02-06T20:02:47.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "margin", "padding" ], "versions": [], "issuelinks": [ { "id": "57138", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "outwardIssue": { "id": "172968", "key": "TIMOB-26804", "fields": { "summary": "Implement Padding property for all Views", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": null, "updated": "2019-03-05T04:05:57.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10224", "name": "TiAPI", "description": "This component is used for cross-platform API work. Specifications are most likely to use this component." } ], "description": "Add {{Margin}} property to {{Ti.UI.View}}.\r\n\r\n", "attachment": [], "flagged": false, "summary": "Implement Margin property for all Views", "creator": { "name": "bhouse", "key": "bhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "bhouse", "key": "bhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "environment": null, "comment": { "comments": [ { "id": "446530", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Now that I think about it, we already do support margins.\r\n\r\nIf you set a view's \"width\" property, then its \"left\" and \"right\" properties will act as margins.\r\nIf you set a view's \"height\" property, then its \"top\" and \"bottom\" properties will act as margins.\r\n\r\nFor example, the below will set up an auto-sized label with a margin of \"5dp\" around it. Note that it's important that you set the width and height to {{Ti.UI.SIZE}} or else the top/bottom/left/right properties will be used to size the view instead via our pinning feature.\r\n{code:javascript}\r\nvar label = Ti.UI.createLabel({\r\n\ttext: \"My Margin Test\",\r\n\twidth: Ti.UI.SIZE,\r\n\theight: Ti.UI.SIZE,\r\n\ttop: \"5dp\",\r\n\tbottom: \"5dp\",\r\n\tleft: \"5dp\",\r\n\tright: \"5dp\",\r\n});\r\n{code}\r\n\r\n[~bhouse], what do you think?", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-03-05T03:51:10.000+0000", "updated": "2019-03-05T03:51:49.000+0000" }, { "id": "446531", "author": { "name": "bhouse", "key": "bhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "body": "The problem is that setting the size to Ti.UI.SIZE isn't always possible. For example, if you are trying to create a gridview w/ tiles . You might want each one to be a certain width/height. I've been able to work around it w/ embedded views but I usually have one embedded view for margin and and second embedded view for padding.", "updateAuthor": { "name": "bhouse", "key": "bhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "created": "2019-03-05T03:58:03.000+0000", "updated": "2019-03-05T03:58:03.000+0000" }, { "id": "446532", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It'll work for your case too. As long as you set the \"width\" and \"height\" properties to a value of some kind, then the top/bottom/left/right properties will act as margins. This works on all platforms (Android, iOS, and Windows).", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-03-05T04:01:02.000+0000", "updated": "2019-03-05T04:01:02.000+0000" }, { "id": "446533", "author": { "name": "bhouse", "key": "bhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "body": "cool! let me try it out. Maybe we can add a helper property called margin that sets the top,bottom,left, and right. ", "updateAuthor": { "name": "bhouse", "key": "bhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "created": "2019-03-05T04:05:57.000+0000", "updated": "2019-03-05T04:05:57.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }