{ "id": "63623", "key": "TIMOB-2991", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2011-04-15T03:34:19.000+0000", "created": "2011-04-15T03:34:19.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "bug", "in", "ios", "scrollview", "tableview" ], "versions": [], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-29T15:55:26.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 a user has 2 tableViews that they want to scroll through as a\nGrouped tables, one and then the other. Scrollview either does not\nscroll, or puts one table on top of the other.

\n

Ticket Reference: http://developer.appcelerator.com/helpdesk/view/68531

\n

Test Code:

\n
\nvar win = Ti.UI.createWindow();\nvar view = Ti.UI.createView({});\nvar scrollView = Ti.UI.createScrollView({\n  contentHeight:'auto',\n  contentWidth:'auto', \n  top:0, \n  opacity:0.5\n});\n\nvar table1 = Ti.UI.createTableView({\n  style:Titanium.UI.iPhone.TableViewStyle.GROUPED, \n  top:0\n  });\nvar table2 = Ti.UI.createTableView({\n  style:Titanium.UI.iPhone.TableViewStyle.GROUPED, \n  top:0\n  });\n\nvar count = 20;\nvar data = [];\n\nfor (var c=0;c<count;c++)\n{\n  var row = Ti.UI.createTableViewRow({title:\"Row \"+(c+1)});\n  data[c] = row;\n}\n\ntable1.data = data;\n\nvar inputData = [\n  {title:'row 1', header:'Header 1'},\n  {title:'row 2'},\n  {title:'row 3'},\n  {title:'row 4', header:'Header 2'},\n  {title:'row 5'}\n];\n\ntable2.data = inputData;\n\nscrollView.add(table2);\n\nscrollView.add(table1);\n\nwin.add(scrollView);\n\nwin.open();\n
{html}", "attachment": [], "flagged": false, "summary": "iOS Bug: ScrollView can't carry 2 tableviews", "creator": { "name": "aleard", "key": "aleard", "displayName": "Alan Leard", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "aleard", "key": "aleard", "displayName": "Alan Leard", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "129816", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

1) The code asks for the scrollable height to be '100%'. 100% of\nwhat is undefined, so it's likely 0, and rounded up to the viewable\narea, making the scroll view, er, scrollless.

\n

2) The scrollview hasn't been assigned a layout, so absolute is\nthe default.

\n

3) Even if vertical layout was used, the height of the table\nviews were not specified, and would fill up the parent container by\ndefault.

\n

4) The auto height of a table view is undefined because of how\nrows work at the OS level.

\n

5) Similarly, trying to lay it all out inside a scrollview is\nprohibitively expensive because it robs the table view of view\nrecycling.

\n

6) Because of this, each table view scrolls by itself\nindependently. That's what they do.

\n

7) So if you want two tableviews acting as one, use only one\ntableview. No scrollview needed.

\n
\nvar win = Ti.UI.createWindow();\nvar table = Ti.UI.createTableView({\n  style:Titanium.UI.iPhone.TableViewStyle.GROUPED, \n  top:0\n  });\n\nvar count = 20;\nvar data = [];\n\nfor (var c=0;c<count;c++)\n{\n  var row = Ti.UI.createTableViewRow({title:\"Row \"+(c+1)});\n  data[c] = row;\n}\n\ndata.push({title:'row 1', header:'Header 1'});\ndata.push({title:'row 2'});\ndata.push({title:'row 3'});\ndata.push({title:'row 4', header:'Header 2'});\ndata.push({title:'row 5'});\n\ntable.data = data;\n\nwin.add(table);\n\nwin.open();\n
{html}", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:34:19.000+0000", "updated": "2011-04-15T03:34:19.000+0000" }, { "id": "416151", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-29T15:55:26.000+0000", "updated": "2017-03-29T15:55:26.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }