{ "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}

Problem

\n

If you set the height of a table view to \"auto\", its height will\nend up as 0 regardless of its content.

\n

Expected Behavior

\n

A table view with height: 'auto' should calculate its height\nbased on the heights of its rows.

\n

Log

\n
\n[WARN] [object TiUITableView] has an auto height value of 0, meaning this view may not be visible.\n
\n

Sample Code

\n

The 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
\n

Associated Helpdesk Ticket

\n

http://developer.appcelerator.com/helpdesk/view/76514

{html}", "attachment": [], "flagged": false, "summary": "iOS: Support TableView Auto Height (on the table itself)", "creator": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "environment": null, "comment": { "comments": [ { "id": "130602", "author": { "name": "tonylukasavage1", "key": "tonylukasavage1", "displayName": "tonylukasavage1", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

I'm having this issue as well. height:'auto' just returns zero\nfor the height. Thanks for the workaround Dawson.

{html}", "updateAuthor": { "name": "tonylukasavage1", "key": "tonylukasavage1", "displayName": "tonylukasavage1", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:43:09.000+0000", "updated": "2011-04-15T03:43:09.000+0000" }, { "id": "133482", "author": { "name": "iantearle", "key": "iantearle", "displayName": "Ian Tearle", "active": true, "timeZone": "Europe/London" }, "body": "I am finding that the message:\n\n [WARN] [object TiUITableView] has an auto height value of 0, meaning this view may not be visible. \n\nis reporting on Vertical layouts too, this is not just confined to table layouts. height: 'auto', is not being reported properly in:\n\n Ti.UI.createLabel\n Ti.UI.createView", "updateAuthor": { "name": "iantearle", "key": "iantearle", "displayName": "Ian Tearle", "active": true, "timeZone": "Europe/London" }, "created": "2011-05-12T05:07:25.000+0000", "updated": "2011-05-12T05:07:25.000+0000" }, { "id": "167648", "author": { "name": "rvallee", "key": "rvallee", "displayName": "Richard Vallee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The workaround cannot work with variable height rows, which is a pretty frequent occurrence.\r\n\r\nIs there anything possible here on v1.7.2? The API itself has to know the actual height of its content, it's just a matter of making available. This is hardly trivial, at least minor.", "updateAuthor": { "name": "rvallee", "key": "rvallee", "displayName": "Richard Vallee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-03T11:13:34.000+0000", "updated": "2011-10-03T11:13:34.000+0000" }, { "id": "453547", "author": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It has been decided that this issue should be closed as “Won’t do.” This issue is out of date with our current supported SDK release (7.5.2.GA as of the date of closure), and out of date with mobile OS versions. Updating, or creating code may not reproduce the issue reported, or be a valid test case.\r\n\r\nIf community members feel that the issue is still valid, please create a new ticket. Please reference this closed ticket number, include SDK used, comments, and code that demonstrates/reproduces the issue.", "updateAuthor": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-09T18:52:00.000+0000", "updated": "2020-01-09T18:52:00.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }