{ "id": "85303", "key": "TIMOB-7336", "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-06-06T11:48:30.000+0000", "created": "2012-01-23T10:04:28.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "api" ], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-24T18:17:43.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "Using Ti 1.8.0.1 with Android and V8, Labels always have their size.height and size.width properties set to 0. They obviously can't be calculated before the window is open, but after it is and the labels are drawn these properties should be set correctly.\r\n\r\nHere is code to reproduce:\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({ backgroundColor: \"#fff\" });\r\nwin.addEventListener(\"open\", function() { \r\n\t\r\n\t//create labels.\r\n\tvar label1 = Ti.UI.createLabel({ text: \"label 1 with height auto\", color: \"#000\", top: 0, left: 0, height: \"auto\" });\r\n\twin.add(label1);\r\n\t\r\n\tvar label2 = Ti.UI.createLabel({ text: \"label 2 with width set and height auto\", color: \"#000\", top: 50, left: 0, width: 250, height: \"auto\" });\r\n\twin.add(label2);\r\n\t\r\n\tvar label3 = Ti.UI.createLabel({ text: \"label 3 with width and height set\", color: \"#000\", top: 100, left: 0, width: 250, height: 30 });\r\n\twin.add(label3);\r\n\t\r\n\t//output label heights.\r\n\tTi.API.info(\"label 1 height: \" + label1.size.height);\r\n\tTi.API.info(\"label 2 height: \" + label2.size.height);\r\n\tTi.API.info(\"label 3 height: \" + label3.size.height);\r\n\r\n});\r\nwin.open();\r\n{code}\r\n\r\nResults:\r\nandroid 2.2 emulator (V8): label 1 height: 0, label 2 height: 0, label 3 height: 0 <--incorrect\r\ndroid x2 w/android 2.3.4 (V8): label 1 height: 0, label 2 height: 0, label 3 height: 0 0 <--incorrect\r\niphone simulator: label 1 height: 22, label 2 height: 42, label 3 height: 30 <--correct", "attachment": [], "flagged": false, "summary": "Android: Size.height and size.width are always 0 for Labels created after window is opened", "creator": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "environment": null, "comment": { "comments": [ { "id": "180680", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Possible duplicate of TIMOB-5303. Mauro to investigate.", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2012-01-26T09:46:23.000+0000", "updated": "2012-01-26T09:46:23.000+0000" }, { "id": "197540", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "When the \"open\" event is fired, the layout is not finished yet. Therefore the size.height and size.width for labels are not correctly calculated at that time. Maybe you want to try the event \"postlayout\" which is fired when the layout is finished. \r\nThe attached test case behaves as expected.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-06T11:46:40.000+0000", "updated": "2012-06-06T11:46:40.000+0000" }, { "id": "197548", "author": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "body": "As you can see, this bug was from long before the 2.0 release and the \"postlayout\" event.", "updateAuthor": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "created": "2012-06-06T12:04:56.000+0000", "updated": "2012-06-06T12:04:56.000+0000" }, { "id": "415658", "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:17:43.000+0000", "updated": "2017-03-24T18:17:43.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }