{ "id": "99420", "key": "TIMOB-10506", "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": "19542", "description": "", "name": "Release 6.2.2", "archived": false, "released": true, "releaseDate": "2017-09-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-10-02T22:48:21.000+0000", "created": "2012-08-20T03:51:23.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "core" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-10-02T22:48:21.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": "h2. Problem\r\n\r\nScrollView does not scroll when it contains TableView.\r\n\r\nh2. Test case\r\n\r\nTo see that, run this example:\r\n\r\n{code}\r\nfunction createContent() {\r\n    var wrapper = Ti.UI.createView({\r\n        width: Ti.UI.FILL,\r\n        height: Ti.UI.SIZE,\r\n        backgroundColor: '#f00',\r\n\t\thorizontalWrap: true,\r\n        layout: 'horizontal'\r\n    });\r\n     \r\n    var label1 = Ti.UI.createLabel({\r\n        text: 'Label 1',\r\n        width: '50%'\r\n    });\r\n     \r\n    var cb1 = Ti.UI.createSwitch({\r\n        value: false\r\n    });\r\n     \r\n    wrapper.add(label1);\r\n    wrapper.add(cb1);\r\n     \r\n    return wrapper;\r\n}\r\n \r\nvar win = Ti.UI.createWindow({\r\n    navBarHidden: true\r\n});\r\n \r\nvar scrollView = Ti.UI.createScrollView({\r\n    height: Ti.UI.FILL,\r\n    width: Ti.UI.FILL,\r\n    backgroundColor: '#0f0',\r\n    layout: 'vertical',\r\n    contentHeight: Ti.UI.SIZE,\r\n    contentWidth: Ti.UI.FILL\r\n});\r\n \r\nwin.add(scrollView);\r\n \r\nfor (var i = 0; i < 10; ++i) {\r\n    scrollView.add(createContent());\r\n}\r\n \r\nvar table = Ti.UI.createTableView({\r\n    backgroundColor: '#00f',\r\n    height: Ti.UI.SIZE\r\n});\r\n \r\nscrollView.add(table);\r\n \r\nvar rows = [];\r\nfor (i = 0; i < 25; ++i) {\r\n    rows.push({ title: 'Row ' + i});\r\n}\r\n \r\ntable.setData(rows);\r\n \r\nwin.open();\r\n{code}\r\n\r\nTry to scroll. You'll see that scrolling is not happening.\r\n\r\nh2. Expected result\r\n\r\nScrollView should scroll.\r\n\r\nWorks fine on iOS.", "attachment": [], "flagged": false, "summary": "Android: \"ScrollView\" does not scroll when it contains \"TableView\"", "creator": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "* Titanium SDK 2.2.0.v20120817153314\r\n* v8\r\n* Android 4.0.3\r\n* Thinkpad Tablet\r\n* OSX ML", "comment": { "comments": [ { "id": "216992", "author": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Note that the docs explicitly recommend against the reverse case--putting a scrollview in a tableview--because nesting two scrolling controls like this can make for unfortunate user experience. We should probably recommend against this case as well.\r\n\r\nIt's true that in iOS, if you size the table view height to Ti.UI.SIZE as you're doing here, it works. It also works on Mobile Web, so you could make an argument for fixing this on Android. \r\n\r\nHowever, you can also get the same effect by creating a single table view with two sections, and it works on all three platforms.\r\n\r\n{code}\r\nfunction createContent() {\r\n\tvar wrapper = Ti.UI.createView({\r\n\t\twidth : Ti.UI.FILL,\r\n\t\theight : Ti.UI.SIZE,\r\n\t\tbackgroundColor : '#f00',\r\n\t\thorizontalWrap : true,\r\n\t\tlayout : 'horizontal'\r\n\t});\r\n\r\n\tvar label1 = Ti.UI.createLabel({\r\n\t\ttext : 'Label 1',\r\n\t\twidth : '50%',\r\n\t\theight : Ti.UI.SIZE\r\n\t});\r\n\r\n\tvar cb1 = Ti.UI.createSwitch({\r\n\t\tvalue : false\r\n\t});\r\n\r\n\twrapper.add(label1);\r\n\twrapper.add(cb1);\r\n\treturn wrapper;\r\n}\r\n\r\nvar win = Ti.UI.createWindow({\r\n\tnavBarHidden : true\r\n});\r\n\r\nvar section1 = Ti.UI.createTableViewSection();\r\nvar row;\r\nfor (var i = 0; i < 10; ++i) {\r\n\trow = Ti.UI.createTableViewRow();\r\n\trow.add(createContent());\r\n\tsection1.add(row);\r\n}\r\n\r\nvar section2 = Ti.UI.createTableViewSection({\r\n\tborderRadius : 10\r\n});\r\nfor ( i = 0; i < 25; ++i) {\r\n\tsection2.add(Ti.UI.createTableViewRow({\r\n\t\ttitle : 'Row ' + i\r\n\t}));\r\n}\r\n\r\nvar table = Ti.UI.createTableView({\r\n\tbackgroundColor : '#00f',\r\n\tdata : [section1, section2]\r\n});\r\n\r\nwin.add(table);\r\nwin.open();\r\n{code}\r\n\r\n", "updateAuthor": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-30T09:32:59.000+0000", "updated": "2012-08-30T09:32:59.000+0000" }, { "id": "241530", "author": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Issue reproduces with\nTitanium Studio, build: 3.0.1.201212181159\nTitanium SDK version: 3.1.0 (03/11/13 15:43 0c88429)\nTitanium SDK version: 3.0.2 (02/07/13 16:46 a4def81)\nDevice: Samsung galaxy s duos Android version: 4.0.4", "updateAuthor": { "name": "jithinv@exalture.com", "key": "jithinv@exalture.com", "displayName": "jithinpv", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-11T06:40:54.000+0000", "updated": "2013-03-11T06:40:54.000+0000" }, { "id": "428651", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Nested scrolling support on Android was added in Titanium 6.2.2. See [TIMOB-25086].", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-10-02T22:47:03.000+0000", "updated": "2017-10-02T22:47:03.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }