简体   繁体   English

如何在iOS App上删除黑条WebView?

[英]How to remove black bar WebView on iOS App?

I put WebView on DetailViewController (From template MasterViewController) and set constraints like below picture. 我将WebView放在DetailViewController上(来自模板MasterViewController),并设置如下图所示的约束。 But when navigate to every url, it has a black bar on top and it disappear when scroll down. 但是,当导航到每个URL时,它的顶部都有一个黑条,而向下滚动时它会消失。 How can I remove it? 如何删除?

WebView 网页浏览

WebView有黑色空格键

设置WebView背景=清除颜色时

Constraints set 约束集

约束条件

Set UIWebView background colour to clear. 设置UIWebView背景颜色为清除。 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. 确定,我通过将WebView的顶部边缘拖动到视图控制器的顶部来解决问题。 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. 如果您不能将WebView拖到ViewController的顶部(当WebView顶部有一个额外的UI时), WebView放一个Container View并在其中移动Web视图。 It will loose the connection to Navigation Controller and will stop drawing that grey placeholder. 它将断开与Navigation Controller的连接,并将停止绘制该灰色占位符。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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