{ "id": "103510", "key": "TIMOB-11508", "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": "14613", "description": "Release 2.1.4", "name": "Release 2.1.4", "archived": true, "released": true, "releaseDate": "2012-11-12" }, { "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" }, { "id": "14169", "description": "2012 Sprint 22 Core", "name": "2012 Sprint 22 Core", "archived": true, "released": true, "releaseDate": "2012-11-05" }, { "id": "14274", "description": "2012 Sprint 22", "name": "2012 Sprint 22", "archived": true, "released": true, "releaseDate": "2012-11-05" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-10-26T23:47:43.000+0000", "created": "2012-10-16T21:59:39.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SupportTeam", "core", "module_scrollview", "qe-review", "qe-testadded" ], "versions": [ { "id": "14137", "description": "Release 2.1.3", "name": "Release 2.1.3", "archived": true, "released": true, "releaseDate": "2012-10-03" } ], "issuelinks": [], "assignee": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-19T12:42:42.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": "h3. Issue\r\n\r\nWhen a WebView is added to a ScrollView containing multiple views stacked vertically, the scrollView get scrolled down to where the WebView has been added (bottom), causing the page to load with the ScrollView initially displaying Accounts near the bottom of the list.\r\n\r\nh3. Sample Test case\r\n\r\n{noformat}\r\nTitanium.UI.setBackgroundColor('#000');\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor : 'white'\r\n});\r\n\r\n//Create scroll view\r\nvar scrollView = Titanium.UI.createScrollView({\r\n contentHeight : 'auto',\r\n layout : 'vertical',\r\n backgroundColor : 'transparent',\r\n showVerticalScrollIndicator : true\r\n});\r\n\r\n//Add to scrollView\r\nfor (var i = 0; i < 20; i++) {\r\n scrollView.add(Titanium.UI.createView({\r\n height : 85,\r\n width : 300,\r\n backgroundColor : 'blue',\r\n top : 10,\r\n borderRadius : 6\r\n }));\r\n\r\n}\r\n\r\n//Add webView -- causes scrollView to scroll down\r\nvar webView = Ti.UI.createWebView({\r\n touchEnabled : false,\r\n showScrollbars : false,\r\n scrollType : 'vertical',\r\n willHandleTouches : false,\r\n backgroundColor : 'red',\r\n scrollable : false,\r\n top : 20,\r\n height : 40\r\n});\r\n\r\nscrollView.add(webView);\r\n\r\nwin.add(scrollView);\r\nwin.open(); \r\n{noformat}\r\n\r\n*In iOS, the top most view is visible first.*", "attachment": [], "flagged": false, "summary": "Android: Adding WebView to ScrollView causes ScrollView to be initialized scrolled-down", "creator": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "environment": "Platform SDK: 2.1.3.GA\r\nPlatform OS: Android", "comment": { "comments": [ { "id": "225125", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Another test case for horizontal scroll views:\n\n{code}\nTitanium.UI.setBackgroundColor('#000');\nvar win = Ti.UI.createWindow({\n backgroundColor : 'white'\n});\n \n//Create scroll view\nvar scrollView = Titanium.UI.createScrollView({\n contentHeight : 'auto',\n layout : 'horizontal',\n\thorizontalWrap: 'false',\n backgroundColor : 'transparent',\n scrollType : 'horizontal'\n});\n \n//Add to scrollView\nfor (var i = 0; i < 20; i++) {\n scrollView.add(Titanium.UI.createView({\n height : 85,\n width : 50,\n backgroundColor : 'blue',\n left : 10,\n borderRadius : 6\n }));\n \n}\n \n//Add webView -- causes scrollView to scroll down\nvar webView = Ti.UI.createWebView({\n touchEnabled : false,\n showScrollbars : false,\n scrollType : 'vertical',\n willHandleTouches : false,\n backgroundColor : 'red',\n scrollable : false,\n left : 10,\n height : 40\n});\n \nscrollView.add(webView);\n \nwin.add(scrollView);\nwin.open(); \n{code}", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-26T18:03:46.000+0000", "updated": "2012-10-26T18:03:46.000+0000" }, { "id": "225143", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I would highly suggest *not* putting web views in scroll views, *especially* in iOS. In [Apple's own docs |https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIWebView_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006950-CH3-DontLinkElementID_1] they stipulate:\nbq. *Important:* You should not embed {{UIWebView}} or {{UITableView}} objects in {{UIScrollView}} objects. If you do so, unexpected behavior can result because touch events for the two objects can be mixed up and wrongly handled.\n\nUIScrollView is the underlying iOS class behind Ti.UI.ScrollView and Ti.UI.ScrollableView. Long ago, I saw the issue first hand, outside of Titanium. If you have a web view in a scroll view in iOS, you risk the web view becoming unresponsive and never visually updating, with no means to detect nor fix it. Fun times.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-26T18:44:49.000+0000", "updated": "2012-10-26T18:44:49.000+0000" }, { "id": "225176", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/3338", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-26T21:19:39.000+0000", "updated": "2012-10-26T21:19:39.000+0000" }, { "id": "225218", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "2_1_X PR: https://github.com/appcelerator/titanium_mobile/pull/3341", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-26T23:01:37.000+0000", "updated": "2012-10-26T23:01:37.000+0000" }, { "id": "225226", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "3_0_X PR: https://github.com/appcelerator/titanium_mobile/pull/3345", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-26T23:17:21.000+0000", "updated": "2012-10-26T23:17:21.000+0000" }, { "id": "225854", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with 2.1.4.v20121030173408 on Droid 3 2.3.4", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-01T20:35:04.000+0000", "updated": "2012-11-01T20:35:04.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }