IOS WebView Plain Space

I included a Youtube video in my iOS 8.3 application using the standard inline url ( sample ) URL , which works as expected but looks pretty weird. This white gap (the blue area at the inspector of the view tree) should not be there.

View tree

I can confirm this not as a problem with CSS, as the inspector shows that it actually takes up 100% of the width and height of the uiWebView component.

enter image description here

I have installation restrictions in the left, top and right borders to align window / layout guides so that is not a problem. It seems that the private _UIWebViewScrollView component accepts the entire height assigned to the UIWebView and pushes the real content (UIWebViewBrowserView) to the bottom of the specified area.

ViewTree UIWebViewBrowserView detail

, , , , , , .

, , - view, . .

+4
3

.

  override func viewWillLayoutSubviews() {
    super.viewWillLayoutSubviews();

    playerWebView.scrollView.contentInset = UIEdgeInsetsZero;
  }

i, , , #.

+15

Swift 3: UIWebView

override func viewWillLayoutSubviews() {
    super.viewWillLayoutSubviews();

    webView.scrollView.contentInset = UIEdgeInsets.zero;
}
+2

Update for Quick 3

webViewResetPassw.scrollView.contentInset = UIEdgeInsets.zero
0
source

Source: https://habr.com/ru/post/1584797/


All Articles