{ "id": "87901", "key": "TIMOB-8077", "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": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "13277", "name": "Sprint 2012-08", "archived": true, "released": true, "releaseDate": "2012-04-22" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-07-12T23:46:51.000+0000", "created": "2012-03-14T07:03:24.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "TableView", "api", "iOS", "module_tableview", "qe-testadded", "release-note" ], "versions": [], "issuelinks": [], "assignee": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-07-13T11:57:06.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": "When using many or complex rows in a table view, in connection with a pull to refresh UI, the table does not always stay stuck down (with things like a reloading message showing).\r\n\r\nTo reproduce, do the following:\r\n- Run the following code on device (simulator works fine)\r\n- Scroll down the table a bit.\r\n- scroll back up and try to do a pull to refresh a few times.\r\n\r\nThe result:\r\nThe table will not always stay \"pulled down\" by 60. sometimes it will, but more often it will be around 5. If however you pull down and hold the table down for about a second before releasing, it seems to work correctly.\r\n\r\nThe code to re-create this issue is in the kitchen sink, I just am having it run with more rows to make the issue more clear... the issue is also clear when using more complex row layouts.\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\n\r\nfunction formatDate()\r\n{\r\n\tvar date = new Date();\r\n\tvar datestr = date.getMonth()+'/'+date.getDate()+'/'+date.getFullYear();\r\n\tif (date.getHours()>=12)\r\n\t{\r\n\t\tdatestr+=' '+(date.getHours()==12 ? date.getHours() : date.getHours()-12)+':'+date.getMinutes()+' PM';\r\n\t}\r\n\telse\r\n\t{\r\n\t\tdatestr+=' '+date.getHours()+':'+date.getMinutes()+' AM';\r\n\t}\r\n\treturn datestr;\r\n}\r\n\r\nvar data = [];\r\n\r\nfor(i=0; i<600; i++) {\r\n\tdata.push({title:\"Row \"+i});\r\n}\r\n\r\nvar lastRow = 4;\r\n\r\nvar tableView = Ti.UI.createTableView({\r\n\tdata: data\r\n});\r\n\r\nwin.add(tableView);\r\n\r\nvar border = Ti.UI.createView({\r\n\tbackgroundColor:\"#576c89\",\r\n\theight:2,\r\n\tbottom:0\r\n});\r\n\r\nvar tableHeader = Ti.UI.createView({\r\n\tbackgroundColor:\"#e2e7ed\",\r\n\twidth:320,\r\n\theight:60\r\n});\r\n\r\n// fake it til ya make it.. create a 2 pixel\r\n// bottom border\r\ntableHeader.add(border);\r\n\r\nvar arrow = Ti.UI.createView({\r\n\tbackgroundImage:\"../images/whiteArrow.png\",\r\n\twidth:23,\r\n\theight:60,\r\n\tbottom:10,\r\n\tleft:20\r\n});\r\n\r\nvar statusLabel = Ti.UI.createLabel({\r\n\ttext:\"Pull to reload\",\r\n\tleft:55,\r\n\twidth:200,\r\n\tbottom:30,\r\n\theight:\"auto\",\r\n\tcolor:\"#576c89\",\r\n\ttextAlign:\"center\",\r\n\tfont:{fontSize:13,fontWeight:\"bold\"},\r\n\tshadowColor:\"#999\",\r\n\tshadowOffset:{x:0,y:1}\r\n});\r\n\r\nvar lastUpdatedLabel = Ti.UI.createLabel({\r\n\ttext:\"Last Updated: \"+formatDate(),\r\n\tleft:55,\r\n\twidth:200,\r\n\tbottom:15,\r\n\theight:\"auto\",\r\n\tcolor:\"#576c89\",\r\n\ttextAlign:\"center\",\r\n\tfont:{fontSize:12},\r\n\tshadowColor:\"#999\",\r\n\tshadowOffset:{x:0,y:1}\r\n});\r\n\r\nvar actInd = Titanium.UI.createActivityIndicator({\r\n\tleft:20,\r\n\tbottom:13,\r\n\twidth:30,\r\n\theight:30\r\n});\r\n\r\ntableHeader.add(arrow);\r\ntableHeader.add(statusLabel);\r\ntableHeader.add(lastUpdatedLabel);\r\ntableHeader.add(actInd);\r\n\r\ntableView.headerPullView = tableHeader;\r\n\r\n\r\nvar pulling = false;\r\nvar reloading = false;\r\n\r\nfunction beginReloading()\r\n{\r\n\t// just mock out the reload\r\n\tsetTimeout(endReloading,2000);\r\n}\r\n\r\nfunction endReloading()\r\n{\r\n\t// simulate loading\r\n\tfor (var c=lastRow;c -65.0 && offset < 0)\r\n\t{\r\n\t\tpulling = false;\r\n\t\tvar t = Ti.UI.create2DMatrix();\r\n\t\tarrow.animate({transform:t,duration:180});\r\n\t\tstatusLabel.text = \"Pull down to refresh...\";\r\n\t}\r\n});\r\n\r\ntableView.addEventListener('scrollEnd',function(e)\r\n{\r\n\tif (pulling && !reloading && e.contentOffset.y <= -65.0)\r\n\t{\r\n\t\treloading = true;\r\n\t\tpulling = false;\r\n\t\tarrow.hide();\r\n\t\tactInd.show();\r\n\t\tstatusLabel.text = \"Reloading...\";\r\n\t\ttableView.setContentInsets({top:60},{animated:true});\r\n\t\tarrow.transform=Ti.UI.create2DMatrix();\r\n\t\tbeginReloading();\r\n\t}\r\n});\r\n\r\n\r\n\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: TableView - setContentInsets not working correctly, values assigned are not always respected", "creator": { "name": "mattapperson", "key": "mattapperson", "displayName": "me@gmail.com", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mattapperson", "key": "mattapperson", "displayName": "me@gmail.com", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK version: 2.0.0 (03/08/12 12:47 4bc31b0) (also pervious GA versions going back to 1.7.1 were tested)\r\nOSX 10.7.3\r\niOS 5.0.1 and 4.3\r\niPhone 4s / iPad 2", "comment": { "comments": [ { "id": "191254", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "updated the test case", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-16T17:16:27.000+0000", "updated": "2012-04-16T17:16:27.000+0000" }, { "id": "191262", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "While closing out the ticket make sure to test the against [this code|https://gist.github.com/2402543] to make sure that the scrollEnd is still being generated.\r\n\r\nNote that values returned by scrollEnd event has changed and is now being generated at the `end of scrolling` and `not at the end of dragging by the user`.", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-16T17:41:55.000+0000", "updated": "2012-04-16T17:41:55.000+0000" }, { "id": "191263", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR [2017|https://github.com/appcelerator/titanium_mobile/pull/2017] pending against 2.1.0", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-16T17:42:36.000+0000", "updated": "2012-04-16T17:42:36.000+0000" }, { "id": "191743", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The good news is that this pull will fix the iOS behavior to match Android and the documentation. The bad news is that the JS needs fixing. Sabil has made the changes to the sample code, and the end developer's code will need similar changes.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-18T18:03:16.000+0000", "updated": "2012-04-18T18:14:14.000+0000" }, { "id": "191862", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR merged", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-19T11:45:03.000+0000", "updated": "2012-04-19T11:45:03.000+0000" }, { "id": "199909", "author": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing issue\r\n\r\nTested with Ti Studio build 2.1.0.201206211609\r\nTi Mobile SDK 2.1.0.v20120622174154 hash rdc9dfbe5\r\nOSX Lion 10.7.3\r\niPhone 4S OS 5.1\r\n\r\nVerified expected behavior is shown", "updateAuthor": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-23T13:06:00.000+0000", "updated": "2012-06-23T13:06:00.000+0000" }, { "id": "203086", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Re-opening to edit label", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-12T23:46:27.000+0000", "updated": "2012-07-12T23:46:27.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }