{ "id": "79599", "key": "TIMOB-5101", "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" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-07-12T13:34:54.000+0000", "created": "2011-08-24T14:57:20.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "api", "qe-port" ], "versions": [ { "id": "11570", "description": "", "name": "Release 1.7.2", "archived": true, "released": true, "releaseDate": "2011-07-21" } ], "issuelinks": [], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-08-16T14:52: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": "ScrollableView changes pages when device is rotated.\r\n\r\nStep 1: run example 1 below\r\nStep 2: scroll to page 3\r\nStep 3: rotate the device to horizontal (left or right)\r\nStep 4: notice the page changes to page 2\r\nStep 5: run example 2 below\r\nStep 6: switch to tab 2\r\nStep 7: scroll to page 3\r\nStep 8: rotate the device to horizontal (left or right)\r\nStep 9: notice the page change to page 2\r\nStep 10: rotate the device to portrait and then back to horizontal\r\nStep 11: notice the page change to page 3\r\n\r\n{code:title=\"example 1\"}\r\nvar win = Titanium.UI.createWindow({backgroundColor:'white'});\r\nwin.orientationModes = [\r\n Titanium.UI.PORTRAIT,\r\n Titanium.UI.UPSIDE_PORTRAIT,\r\n Titanium.UI.LANDSCAPE_LEFT,\r\n Titanium.UI.LANDSCAPE_RIGHT,\r\n]; \r\nvar views = [];\r\n\r\nfor(var i = 0; i < 5; i++) {\r\n views.push(\r\n Ti.UI.createLabel({text:'Page: '+(i+1),left:0,right:0,height:50,backgroundColor:'#ccc'})\r\n );\r\n}\r\n\r\nvar sv = Ti.UI.createScrollableView({\r\n left: 20,\r\n right: 20,\r\n top: 20,\r\n clipViews: false,\r\n views: views \r\n});\r\n// work around\r\n// Ti.Gesture.addEventListener('orientationchange',function(e){\r\n // sv.currentPage = sv.currentPage;\r\n// });\r\nwin.add(sv);\r\nwin.open();\r\n{code}\r\n\r\n{code:title=\"example 2\"}\r\nvar tabGroup = Titanium.UI.createTabGroup();\r\n\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\nvar tab1 = Titanium.UI.createTab({ \r\n icon:'KS_nav_views.png',\r\n title:'Tab 1',\r\n window:win1\r\n});\r\n\r\nvar label1 = Titanium.UI.createLabel({\r\n color:'#999',\r\n text:'I am Window 1',\r\n font:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n textAlign:'center',\r\n width:'auto'\r\n});\r\n\r\nwin1.add(label1);\r\n\r\n// Create 2nd window with scrollable view\r\nvar win2 = Titanium.UI.createWindow({\r\n backgroundColor:'#0000ff',\r\n orientationModes:[Ti.UI.LANDSCAPE_RIGHT, Ti.UI.LANDSCAPE_LEFT, Ti.UI.PORTRAIT] \r\n});\r\nvar tab2 = Titanium.UI.createTab({ \r\n icon:'KS_nav_views.png',\r\n title:'Tab 2',\r\n window:win2\r\n});\r\nvar views = [];\r\n\r\nfor(var i = 0; i < 5; i++) {\r\n\r\n var view = Ti.UI.createView({\r\n top:0,\r\n bottom:0,\r\n left:0,\r\n right:0,\r\n backgroundColor: '#00ff00'\r\n });\r\n var viewLabel = Titanium.UI.createLabel({\r\n color:'#999',\r\n text:'Page '+(i+1),\r\n font:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n textAlign:'center'\r\n });\r\n view.add( viewLabel );\r\n\r\n views.push( view );\r\n}\r\n\r\nvar sv = Ti.UI.createScrollableView({\r\n id:'scroller',\r\n showPagingControl:false,\r\n top:0,\r\n bottom:0,\r\n left:0,\r\n right:0,\r\n cacheSize:4,\r\n backgroundColor:\"#ff0000\",\r\n views: views \r\n});\r\n\r\n// work around\r\n// Ti.Gesture.addEventListener('orientationchange',function(e){\r\n // sv.currentPage = sv.currentPage;\r\n// });\r\nwin2.add(sv);\r\n\r\ntabGroup.addTab(tab1); \r\ntabGroup.addTab(tab2);\r\n\r\ntabGroup.open();\r\n{code}\r\n\r\nh4. Workaround\r\nNote: It has been reported that this does not always fix the problem, but no repro case for this yet.\r\n{code}\r\n// work around\r\n Ti.Gesture.addEventListener('orientationchange',function(e){\r\n sv.currentPage = sv.currentPage;\r\n });\r\n{code}\r\n\r\nh4. Associated Helpdesk Ticket\r\nhttp://appc.me/c/APP-769267", "attachment": [], "flagged": false, "summary": "iOS: rotating scrollableView changes page aka index", "creator": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 1.7.2\r\niOS Simulator 4.3", "comment": { "comments": [ { "id": "203010", "author": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "body": "Tested on the iOS simulator and on an iPhone 3GS with 2.1GA, unable to reproduce either of the issue. Ticket closed.", "updateAuthor": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "created": "2012-07-12T13:34:54.000+0000", "updated": "2012-07-12T13:34:54.000+0000" }, { "id": "214889", "author": { "name": "rumbrasas", "key": "rumbrasas", "displayName": "Rima Umbrasas", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed with :\r\nMobile sdk-2.2.0.v20120810080115\r\nTitanium Studio, build: 2.1.1.201207271312\r\nDevice:\r\niPhone simulator\r\nIpad 2 version 5.1", "updateAuthor": { "name": "rumbrasas", "key": "rumbrasas", "displayName": "Rima Umbrasas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-16T14:51:15.000+0000", "updated": "2012-08-16T14:52:05.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }