{ "id": "61341", "key": "TIMOB-709", "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": [ { "id": "11223", "name": "Release 1.3.0", "archived": true, "released": true, "releaseDate": "2010-05-05" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:53:59.000+0000", "created": "2011-04-15T02:34:56.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:53:59.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": "{html}

from premium support:

\n

http://helpdesk.appcelerator.net/tickets/1762

{html}", "attachment": [], "flagged": false, "summary": "size.height and size.width properties are 0 when height or width auto is used", "creator": { "name": "nwright", "key": "nwright", "displayName": "Nolan Wright", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "nwright", "key": "nwright", "displayName": "Nolan Wright", "active": false, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "123867", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Partial fix for this that solves the user's problem:

\n

You can't get these values before the window is drawn, because\nthe autosize values are not computed until that time. So what you\ncan do is:

\n
\nvar realWidth = null;\nvar realHeight = null;\nwin.addEventListener('open', function(e) {\n   realWidth = view.size.width;\n   realHeight = view.size.height;\n});\n
\n

Blain says this might not work for tableRowViews, however, since\nthey are lazyload. This should solve the customer's problem\nhowever.

\n

Leaving the bug open until we can come up with a tableRowView\nsolution.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:34:56.000+0000", "updated": "2011-04-15T02:34:56.000+0000" }, { "id": "123868", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Closing this, it's just not possible to get useful size\ninformation without drawing all superviews (which, in the case of\nan element like a label, means drawing everything). The user can\nget the desired behavior by using code like the following:

\n
\nvar label1 = Ti.UI.createLabel({\n    text: 'Some Name',\n    color: 'blue',\n    font: { fontSize: 16}, \n    width: 'auto',\n    height: 'auto',\n    bottom:0,\n    left:0\n});\nwin.add(label1);\n\nvar label2 = Ti.UI.createLabel({\n    text: 'says',\n    font: {fontStyle: 'italic', fontSize: 16},\n    color:'black',\n    width: 'auto',\n    height: 'auto',\n    bottom:0\n});\nwin.add(label2);\n\nwin.addEventListener('open', function(e) {\n    label2.left = label1.size.width+20;\n});\n
\n

Positioning elements based on other autosize elements has to be\ndone on window open (and yes, they are redrawn correctly before\ndisplay). Handling table rows is all done internally and the user\nshould have no control over it. Create another bug if that becomes\nan issue.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:34:56.000+0000", "updated": "2011-04-15T02:34:56.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }