Weird status bar gap for app with UIWebView

Originator:darryl
Number:rdar://32599170 Date Originated:2017-06-06
Status:Closed Resolved:
Product:iOS Product Version:11
Classification:WebKit Reproducible:Always
 
Area:
WebKit

Summary:
On iOS 11, a full-sized UIWebView is pushed down by the height of the status bar.  There appears to be no way to disable this.

Steps to Reproduce:
Create an app with a full-sized UIWebView as its main view.

Expected Results:
The web view should fill the full screen, including behind the status bar.

Observed Results:
The web view is pushed down by the height of the status bar.

Version:
iOS 11 beta 1 (15A5278f)

Notes:
This is viewable in a sample app: https://github.com/dpogue/WKScrollTest/tree/visual-viewport
Edit ViewController.swift and change USE_UIWEBVIEW to true.

Comments

By using viewport-fit=cover in the meta viewport tag or set the property contentInsetAdjustmentBehavior of webview.scrollView works for some pages. However, if your page using CSS property -webkit-overflow-scrolling, UIWebView will create another scrollView as a subview of webview.scrollView which is still pushed down by the height of the status bar, thus page elements will sink down. I guess that the safeareainset affects all the scrollView, so we should set the property contentInsetAdjustmentBehavior of all the scrollViews inside UIWebView. I am still searing for some better solutions.

This is fixed in beta 4 by implementing a workaround using viewport-fit=cover in the meta viewport tag.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!