{ "id": "89886", "key": "TIMOB-8698", "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-10T18:04:53.000+0000", "created": "2012-04-12T03:00:53.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "api" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2020-01-10T18:04:53.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": "h2. Problem\r\n\r\nWhen I create a TableView with style=Ti.UI.iPhone.TableViewStyle.GROUPED and make rows' height to \"auto\", the calculated height is bad.\r\n\r\nh2. Test case\r\n\r\n{code:lang=javascript|title=app.js}\r\nTi.UI.setBackgroundColor('#000');\r\n\r\nvar win = Ti.UI.createWindow({\r\n\ttitle: 'Win',\r\n\tfullscreen: true\r\n});\r\n\r\nvar section = Ti.UI.createTableViewSection();\r\nsection.headerTitle = \"Test\";\r\n\r\nvar row1 = Ti.UI.createTableViewRow({\r\n\thasChild: true,\r\n\theight: 'auto'\r\n});\r\nvar lbl1 = Ti.UI.createLabel({\r\n\ttext: '11111 11111 11111 11111 11111111 1111111 11111111111 111',\r\n\twidth: '100%',\r\n\theight: 'auto'\r\n})\r\nrow1.add(lbl1);\r\nsection.add(row1);\r\n\r\nvar row2 = Ti.UI.createTableViewRow({\r\n\thasChild: true,\r\n\theight: 'auto'\r\n});\r\nvar lbl2 = Ti.UI.createLabel({\r\n\ttext: '222222222 222222 222222 22222222222 22222 2222222222 222',\r\n\twidth: '100%',\r\n\theight: 'auto'\r\n})\r\nrow2.add(lbl2);\r\nsection.add(row2);\r\n\r\nvar tv = Ti.UI.createTableView({\r\n\twidth: '100%',\r\n\theight: '100%',\r\n\tstyle: Ti.UI.iPhone.TableViewStyle.GROUPED,\r\n\tdata: [section]\r\n});\r\nwin.add(tv);\r\n\r\nwin.open();\r\n{code}\r\n\r\nh2. Cause\r\n\r\nThe grouped tableview has padding left and right, the algorithm which calculate the height does not take this into.\r\n\r\nh2. Solution\r\n\r\nI've made a change in TiUITableViewRowProxy.m in sizeWidthForDecorations:forceResizing method. Added this code at the end. This solves the problem.\r\n\r\n{code:lang=none|title=TiUITableViewRowProxy.m}\r\nif ([[table tableView] style]==UITableViewStyleGrouped) {\r\n width -= ([TiUtils isIPad]==NO) ? 20 : 60;\r\n}\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "iOS: TableViewRow auto height in grouped styled TableView", "creator": { "name": "wallner", "key": "wallner", "displayName": "Adam Wallner", "active": true, "timeZone": "Europe/Budapest" }, "subtasks": [], "reporter": { "name": "wallner", "key": "wallner", "displayName": "Adam Wallner", "active": true, "timeZone": "Europe/Budapest" }, "environment": "IOS, Titanium 1.8.2", "comment": { "comments": [ { "id": "194373", "author": { "name": "meeech", "key": "meeech", "displayName": "Mitchell Amihod", "active": true, "timeZone": "America/New_York" }, "body": "This still exists in 2.x. Any chance this will get added?", "updateAuthor": { "name": "meeech", "key": "meeech", "displayName": "Mitchell Amihod", "active": true, "timeZone": "America/New_York" }, "created": "2012-05-10T03:32:16.000+0000", "updated": "2012-06-02T21:30:37.000+0000" }, { "id": "453647", "author": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "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. \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-10T18:04:53.000+0000", "updated": "2020-01-10T18:04:53.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }