UIWebView 上面(反弹部分)的背景颜色
我认为这应该不是一个大问题,但我自己找不到解决方案。一如既往:p 我有一个 UIWebView,其背景颜色设置为clearColor,但是当我尝试向下滚动太多时,我会在加载的 HTML 上方看到深灰色的“弹跳区域”。我想将其更改为透明/白色。有什么办法可以改变这个吗?
题外话:我读到继承 UIScrollView 的类可以具有属性ounce = NO,然后它们根本不会显示弹跳区域。即使 UIWebView 继承了该类,我也不想阻止它弹跳,可以这么说,只是“用白色弹跳它”...
非常感谢,
卢卡
I think this shouldn't be a big problem, but I can't find the solution on my own. As always :p I have an UIWebView that has background color set to clearColor but when I try to scroll down too much I get the "bouncing area" above loaded HTML in dark gray color. I would like to change this to transparent/white. Is there any way of changing this?
Digression: I read that classes inheriting UIScrollView can have property bounce = NO and then they won't show the bouncing area at all. Even if UIWebView was inheriting that class I wouldn't like to stop it from bouncing, just "bounce it in white" so to speak...
Thanks a lot,
Luka
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看看下面的答案
从 UIWebView 中删除渐变背景?
Take a look at the following answer
Remove gradient background from UIWebView?
设置 webview 的背景颜色并将不透明设置为 NO:
或者尝试设置透明颜色作为背景:
Set the webview's background colour and set opaque to NO:
Or try setting clear color as background:
@Ladislav:谢谢你给我指出了正确的主题:)
现在,以下帖子 从 UIWebView 中删除渐变背景? 正是我所需要的,所以很抱歉我打开了新线程。我搜索了论坛,但由于没有这个渐变、反弹背景或背景的名称,所以我之前找不到它。
总结如下:
1.在代码中将Web视图的backgroundColor设置为clearColor!界面生成器中的原因没有产生想要的结果。
这条线只会使“过度滚动”背景看起来更亮,但要完全删除它(使其透明/白色),我们需要隐藏在 myWebView 的子视图中找到的所有 imageView:
谢谢大家,祝您周末愉快
@Ladislav: thanks for pointing me to the right subject :)
Now, the following post Remove gradient background from UIWebView? is exactly what I needed, so I am sorry I opened the new thread. I searched the forum but since there is no name for this gradient, bounce background or background I couldn't find it earlier.
The summary would be:
1.Setting the backgroundColor of web view to clearColor !in code! cause in interface builder is not producing the wanted result.
this line will only make the "overscroll" background look lighter, but to remove it totally (make it transparent/white) we need to hide all imageViews found in subViews of our myWebView:
Thanks everyone, I wish you a great weekend