{ "id": "63988", "key": "TIMOB-3356", "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": "10100", "description": "This issue won't be actioned.", "name": "Won't Do" }, "resolutiondate": "2020-01-09T18:52:00.000+0000", "created": "2011-04-15T03:43:09.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "defect", "ios", "reported-1.6.1", "rplist" ], "versions": [ { "id": "11260", "description": "", "name": "Release 1.6.2", "archived": true, "released": true, "releaseDate": "2011-04-20" } ], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-01-09T18:52:00.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}
If you set the height of a table view to \"auto\", its height will\nend up as 0 regardless of its content.
\nA table view with height: 'auto' should calculate its height\nbased on the heights of its rows.
\n\n[WARN] [object TiUITableView] has an auto height value of 0, meaning this view may not be visible.
\n
\nThe following code demonstrates the problem. Note that you can\nset \"workaround\" to true to calculate the height by spinning\nthrough the rows.
\n\nvar win = Ti.UI.createWindow({\n backgroundColor: '#999'\n});\n\nvar rows = [\n { title: \"Row 1\", height: 30 },\n { title: \"Row 2\", height: 45 },\n { title: \"Row 3\", height: 15 },\n { title: \"Row 4\", height: 30 },\n { title: \"Row 5\", height: 25 }\n];\nvar table = Titanium.UI.createTableView({\n top: 0,\n data: rows,\n height: 'auto'\n});\nvar workaround = false;\nif (workaround) {\n var height = 0;\n for (var i = 0, l = rows.length; i < l; i++) {\n height += rows[i].height;\n }\n table.height = height;\n}\n\nwin.add(table);\n\nwin.open();
\n
\nI'm having this issue as well. height:'auto' just returns zero\nfor the height. Thanks for the workaround Dawson.