{ "id": "83940", "key": "TIMOB-6702", "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": "2011-12-15T14:23:48.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "core", "exalture" ], "versions": [ { "id": "12570", "name": "Release 1.7.5", "archived": true, "released": true, "releaseDate": "2011-11-02" }, { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" }, { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "13272", "description": "Release 2.0.1", "name": "Release 2.0.1", "archived": true, "released": true, "releaseDate": "2012-04-16" } ], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-08-02T17:31:53.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h5. PROBLEM DESCRIPTION\r\nThe customer wants to get the padding functionality provided natively by Android. \r\n\r\nh5. DOCS\r\nhttp://developer.android.com/reference/android/view/View.html\r\n\r\n\r\nTo measure its dimensions, a view takes into account its padding. The padding is expressed in pixels for the left, top, right and bottom parts of the view. Padding can be used to offset the content of the view by a specific amount of pixels. For instance, a left padding of 2 will push the view's content by 2 pixels to the right of the left edge. Padding can be set using the setPadding(int, int, int, int) method and queried by calling getPaddingLeft(), getPaddingTop(), getPaddingRight(), getPaddingBottom().\r\n\r\n\r\nh5. Code \r\n\r\n{code:title=padding.js|borderStyle=solid}\r\n/* Example of padding in labels - \r\n * Mauro Parra-Miranda mauropm@gmail.com \r\n */\r\n\r\n\r\nvar vLabel = Ti.UI.createView({\r\n\twidth: 300, \r\n\theight: 35, \r\n\ttop: 120\r\n});\r\nvar lLabel = Ti.UI.createLabel({\r\n\tleft: 20, \r\n\tright: 20, \r\n\ttext: 'my text', \r\n\theight: 30, \r\n\tbackgroundColor:'#fff'\r\n});\r\n\r\nvLabel.add(lLabel);\r\n\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Padding',\r\n backgroundColor:'#000'\r\n});\r\n\r\n\r\nwin1.add(vLabel);\r\nwin1.open();\r\n\r\n{code}", "attachment": [], "flagged": false, "summary": "TiAPI: Add Padding to Views", "creator": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "subtasks": [], "reporter": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "environment": null, "comment": { "comments": [ { "id": "213497", "author": { "name": "ygbr", "key": "ygbr", "displayName": "Ygor Lemos", "active": true, "timeZone": "America/Sao_Paulo" }, "body": "What about mapping something like: https://gist.github.com/2596057 to the views for iOS? This works great for UILabel but variants can be made for all kinds of views.", "updateAuthor": { "name": "ygbr", "key": "ygbr", "displayName": "Ygor Lemos", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2012-08-08T20:42:28.000+0000", "updated": "2012-08-08T20:42:28.000+0000" }, { "id": "219918", "author": { "name": "ygbr", "key": "ygbr", "displayName": "Ygor Lemos", "active": true, "timeZone": "America/Sao_Paulo" }, "body": "Check this PR https://github.com/appcelerator/titanium_mobile/pull/2645", "updateAuthor": { "name": "ygbr", "key": "ygbr", "displayName": "Ygor Lemos", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2012-09-20T05:08:46.000+0000", "updated": "2012-09-20T05:08:46.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }