{ "id": "170160", "key": "TIMOB-25449", "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": "17609", "description": "", "name": "Release 7.0.0", "archived": false, "released": true, "releaseDate": "2017-12-07" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-11-08T16:17:17.000+0000", "created": "2017-10-27T18:01:52.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "ios", "ios11" ], "versions": [], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-11-08T16:17:32.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": "A \"fullscreen\" Titanium.UI.WebView in 6.2.2.GA (older versions too, at least 6.1.2.GA) will contain a dead zone at the top which is 20dip tall (top bar sized). The bar disappears upon scrolling a page that scrolls, but if a full-screen mapping application which manages its own touches and navigation is used, the bar is constant. This does not appear on Android.\r\n\r\nCode to reproduce:\r\n{code}\r\n// blue to illustrate the white is not from this window\r\nvar win = Ti.UI.createWindow({backgroundColor: 'blue'});\r\n\r\n// full screen webview, background green to show the \"dead\" area at the top\r\nvar webview = Ti.UI.createWebView({\r\n\t// a webpage that has enough content to scroll and has a gray background color\r\n url: 'http://daringfireball.net',\r\n top: 0,\r\n bottom: 0,\r\n left: 0,\r\n right: 0,\r\n backgroundColor: '#00cc00'\r\n});\r\n\r\nwin.add(webview);\r\nwin.open();\r\n{code}\r\n\r\nSee screenshot for example. The green area (#00cc00) is the backgroundColor of the webview. If that color is unset, it defaults to white.\r\n\r\nI'm working around this by hiding the webview inside another view container and setting the top property to -20, but this shouldn't be necessary in my mind.\r\n\r\nThe issue _does not_ seem to happen if you set the top property to something farther down the page by at least 20 dips:\r\n{code}\r\n// blue to illustrate the white is not from this window\r\nvar win = Ti.UI.createWindow({backgroundColor: 'blue'});\r\n\r\n// full screen webview, background green to show the \"dead\" area at the top\r\nvar webview = Ti.UI.createWebView({\r\n\t// a webpage that has enough content to scroll and has a gray background color\r\n url: 'http://daringfireball.net',\r\n top: 20,\r\n bottom: 0,\r\n left: 0,\r\n right: 0,\r\n backgroundColor: '#00cc00'\r\n});\r\n\r\nwin.add(webview);\r\nwin.open();\r\n{code}", "attachment": [ { "id": "63488", "filename": "Screen Shot 2017-10-27 at 1.58.47 PM.png", "author": { "name": "mattmendick", "key": "mattmendick", "displayName": "Matt Mendick", "active": true, "timeZone": "America/New_York" }, "created": "2017-10-27T18:01:43.000+0000", "size": 127782, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: WebView content offset of 20 pixels when positioned at the top", "creator": { "name": "mattmendick", "key": "mattmendick", "displayName": "Matt Mendick", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "mattmendick", "key": "mattmendick", "displayName": "Matt Mendick", "active": true, "timeZone": "America/New_York" }, "environment": "6.2.2.GA, 6.1.2.GA\r\nXcode 9.0.1\r\niOS 11.0\r\niPhone 7 simulator\r\niPad Air 2 simulator", "comment": { "comments": [ { "id": "429749", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "This seems to be a breaking change in iOS 11+ only, iOS 8/9/10 behave correctly. See more details [here|https://stackoverflow.com/a/45973538/5537752]. The fix is to set the content-inset-adjustment-behavior to \"never\". Unfortunately, 6.3.0 is already in prerelease stage and no tickets can be added to the version anymore, but it will then go into 7.0.0 for sure. To fix it today, add the following to your \"TiUIWebView.m\" inside the {{-(UIWebView*)webview }} method in {{~/Library/Application Support/Titanium/mobilesdk/osx/6.2.2.GA/iphone/classes}}:\r\n{code:objc}\r\n#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_11_0\r\n if ([TiUtils isIOSVersionOrGreater:@\"11.0\"]) {\r\n webview.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;\r\n }\r\n#endif\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-10-27T18:14:55.000+0000", "updated": "2017-10-27T18:14:55.000+0000" }, { "id": "429751", "author": { "name": "mattmendick", "key": "mattmendick", "displayName": "Matt Mendick", "active": true, "timeZone": "America/New_York" }, "body": "Hans, that seems to be the issue and the fix did the trick - thanks very much for your help!", "updateAuthor": { "name": "mattmendick", "key": "mattmendick", "displayName": "Matt Mendick", "active": true, "timeZone": "America/New_York" }, "created": "2017-10-27T18:40:41.000+0000", "updated": "2017-10-27T18:40:41.000+0000" }, { "id": "429775", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/9569\r\n\r\nTest-Case: See above", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-10-28T22:15:28.000+0000", "updated": "2017-10-28T22:15:28.000+0000" }, { "id": "430290", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified in SDK build 7.0.0.v20171107142411", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-11-08T16:17:32.000+0000", "updated": "2017-11-08T16:17:32.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }