简体   繁体   中英

How to remove black bar WebView on iOS App?

I put WebView on DetailViewController (From template MasterViewController) and set constraints like below picture. But when navigate to every url, it has a black bar on top and it disappear when scroll down. How can I remove it?

WebView

WebView有黑色空格键

设置WebView背景=清除颜色时

Constraints set

约束条件

Set UIWebView background colour to clear. I guess it will help you.

Uncheck Adjust Scroll View Insets from Attributes inspector by selecting view controller.

在此处输入图片说明

OK I fix issue by drag top edge of WebView to top of view controller. Now it work with no problem!

在此处输入图片说明

If you can't drag WebView to the top of your ViewController -- when you have an extra UI on top of the WebView -- then put a Container View instead and move web view inside it. It will loose the connection to Navigation Controller and will stop drawing that grey placeholder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM