Partial black background in UIWebView on iOS7 after setting content paste

I have a problem with UIWebViewon iOS7:

First I set the content insert to view the scroll of the web view:

[webView.scrollView setContentInset:UIEdgeInsetsMake(40, 0, 0, 0)];

Then, when the webview loads a blank page, there is a black rectangle with a height of 40 at the bottom of the webview.

This is precisely due to the content, and I met this problem only on iOS7. How can i solve this? Any help would be appreciated!

+4
source share
2 answers

Try this code, this is not the best solution, but it will get rid of the black rectangle:

[webView.scrollView setContentInset:UIEdgeInsetsMake(40, 0, -40, 0)];
+11
source

, iOS7 UIWebView . . webview , - contentEditable="true".

UIWebDocumentView/UIWebBrowserView ( " " ) UIWebScrollView scrollview. , subviews webView.scrollView , UIWeb. ( , iOS6 UIWebScrollView .)

. frame .

+3

All Articles