{ "id": "63834", "key": "TIMOB-3202", "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": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-05-17T14:06:44.000+0000", "created": "2011-04-15T03:39:19.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "auto", "defect", "height", "klist", "label", "reported-1.6.0", "rplist", "width" ], "versions": [], "issuelinks": [], "assignee": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-05-17T14:06:44.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": "{html}
If a label width or height is set to 'auto' on android you can\nnot reference label.width or label.size.with. Both work on iOS.
Fixed title, fixed tags, Please provide code that demonstrates\nthe example. If this came from Helpdesk, you need to include that\nlink and add the rplist tag.
\nAlso this behavior is going to be addressed in 1.7.0 as the API\nis inconsistent on both platforms.
Here is some testing code:
\n\nvar win = Ti.UI.createWindow();\n\nvar label = Titanium.UI.createLabel({\n text:'Text',\n color:'#000000',\n font:{ fontFamily:'Helvetica Neue', fontSize:18, fontWeight:'bold'},\n textAlign:'left',\n left:15,\n top:2,\n height:26,\n width:'auto'\n});\n\nwin.add(label);\n\nalert('label.width: '+label.width);\n\nalert('label.height: '+label.height);\n\nalert('label.size.width: '+label.size.width);\n\nalert('label.size.height: '+label.size.height);\n\nwin.open();
\n
\nReference HD Ticket: http://developer.appcelerator.com/helpdesk/view/74851
\nvar label = Ti.UI.createLabel();\nlabel.height = 'auto';\nalert(label.height);
\n
\nTitanium SDK version: 1.6.0 (02/23/11 12:34 9882e81)
\nWORKS on iPhone Simulator 4.2
\nBROKEN on Android Device EPIC 4G 2.1
In 1.7.0 that should return the layout setting on both iOS and\nAndroid. Having configuration properties doubling as dynamic values\ncauses all sorts of problems like this. The correct response from\nthis is 'auto'
While we fix this, the following workaround will allow you to\nachieve the same results with only a little bit more work.
\n\nvar label = Ti.UI.createLabel();\nlabel.rawHeight = label.height = 'auto';\nalert(label.rawHeight);
\n