{ "id": "88810", "key": "TIMOB-8300", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-03-27T09:26:17.000+0000", "created": "2012-03-25T17:07:31.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "regression" ], "versions": [ { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" } ], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-24T18:13:46.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "label.width gives incorrect value, when retrieved. The label is not rendered by the window, but well defined in the code.\r\n\r\nThis works in 1.8.1, and 1.8.2, but fails in 2.0\r\n\r\n{code}\r\nvar win1 = Titanium.UI.createWindow({ \r\n backgroundColor:'white'\r\n});\r\n\r\nvar label = Ti.UI.createLabel({\r\n text: ''\r\n});\r\n\r\nwin1.add(label);\r\n\r\nsetTimeout(function(){\r\n label.text = \"show up\";\r\n Ti.API.info(label.text);\r\n}, 1000);\r\n\r\nwin1.open();\r\n\r\nvar label2 = Ti.UI.createLabel({\r\n text: 'asdadasd asdaj lsdak l',\r\n width: 'auto'\r\n});\r\n\r\nTi.API.info(\"label2 width: \" + label2.size.width);\r\n\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Width and height of label is not correctly retrieved.", "creator": { "name": "dgandhi", "key": "dgandhi", "displayName": "Devang Gandhi", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dgandhi", "key": "dgandhi", "displayName": "Devang Gandhi", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK: CI\r\nPlatform OS: iOS\r\nPlatform OS Version: iOS5\r\n", "comment": { "comments": [ { "id": "188578", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "label2 is never attached to the window so dynamic size will always be 0", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-03-26T09:19:02.000+0000", "updated": "2012-03-26T09:19:02.000+0000" }, { "id": "188780", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "Have you tried label2.toImage().width ?\r\n\r\nEdit: I have confirmed that label2.toImage().width will give you the number you want.", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-03-27T07:03:05.000+0000", "updated": "2012-03-27T10:31:21.000+0000" }, { "id": "188800", "author": { "name": "tlsg", "key": "tlsg", "displayName": "Tommy Leung", "active": true, "timeZone": "America/New_York" }, "body": "The size is available in 1.8.1 and 1.8.2.", "updateAuthor": { "name": "tlsg", "key": "tlsg", "displayName": "Tommy Leung", "active": true, "timeZone": "America/New_York" }, "created": "2012-03-27T08:48:51.000+0000", "updated": "2012-03-27T08:48:51.000+0000" }, { "id": "188809", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "The reason it worked in 1.8.X is because we would blindly create the view every time the size property was accessed. Now we ensure that the view is attached to the UI framework when you access the size property. The reason for this change is to keep the behavior consistent with the rect property of the views.", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-03-27T09:03:18.000+0000", "updated": "2012-03-27T09:03:18.000+0000" }, { "id": "188820", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "The `size` property has been redefined and values returned by size.width and size.height must match the values returned by rect.width and rect.height when no transform is applied to the view. ", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-03-27T09:26:17.000+0000", "updated": "2012-03-27T09:26:17.000+0000" }, { "id": "415644", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-24T18:13:46.000+0000", "updated": "2017-03-24T18:13:46.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }