{ "id": "110321", "key": "TIMOB-12887", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": null, "resolutiondate": null, "created": "2013-02-27T13:39:18.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:43.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" }, { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h1. Feature description\r\n\r\nBefore a TableView is added to a view, there is no way to scroll its content. The reason for doing this, is that (especially with complex tables), even setting the animation to false will show the beginning of the table before scrolling to the needed point.\r\n\r\nThe use case is the follow: having an app such as a messaging app, which should start from the last message (bottom of the table) with the old ones already scrolled up.\r\n\r\nh1. How to see the issue\r\n\r\nUse the following code. When you open the app on a device (Simualtor is fast enough not to show the problem, at least in my case), you can see the first rows for a while, and then the table scrolls to the end.\r\n\r\n{code}\r\nvar win1 = Ti.UI.createWindow({\r\n backgroundColor: \"#FFF\"\r\n});\r\n\r\nvar rows = [];\r\n\r\nfor (var i=0; i<100; i++) {\r\n\tvar row = Ti.UI.createTableViewRow({\r\n\t\tclassName: 'test',\r\n\t\theight: 100,\r\n\t\tlayout: 'horizontal'\r\n\t});\r\n\r\n\tvar image = Ti.UI.createImageView({\r\n\t\timage: 'http://lorempixel.com/100/100?i=' + i\r\n\t});\r\n\r\n\tvar text = Ti.UI.createLabel({\r\n\t\ttext: 'Row ' + (i+1)\r\n\t});\r\n\r\n\trow.add(image);\r\n\trow.add(text);\r\n\r\n\trows.push(row);\r\n}\r\n\r\nvar table = Ti.UI.createTableView({\r\n\tdata: rows\r\n});\r\n\r\n\r\nwin1.add(table);\r\nwin1.open();\r\n\r\ntable.scrollToIndex(99, {\r\n\tanimated: false\r\n});\r\n{code}\r\n\r\nh1. Workaround\r\n\r\nThe only workarond found is to set the opacity of the table to 0, then set it back to 1 after the table has scrolled (e.g. using setTimeout with a 10ms delay).", "attachment": [], "flagged": false, "summary": "TiAPI: Allow TableView to be scrolled BEFORE it is added to a view", "creator": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Android\r\niOS", "comment": { "comments": [], "maxResults": 3, "total": 3, "startAt": 0 } } }