iPhone SDK - UIWebView有一个灰色框 [英] iPhone SDK - UIWebView has a grey box over it

查看:156
本文介绍了iPhone SDK - UIWebView有一个灰色框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时,我的UIWebView会有部分或全部内容的灰色框。我不能做出头或尾的为什么会发生。

Sometimes, my UIWebView will have a grey box over part or all of the content. I can't make heads or tails of why it's happening. It happens regularly for certain content.

感谢!

- 更新 -

当webview在屏幕上不能立即显示时,似乎会发生,也就是说,我有一个scrollview,而且webview位于fold之下。

It seems to occur when the webview is not immediately viewable on the screen -- ie i've got a scrollview, and the webview is below the fold.

- 更新#2 -

--Update #2--

当我将内容放在首屏时,大部分时间都会加载。仍然存在灰色框仍然显示的情况。奇怪的部分是如果我双击它,它完成加载内容就好了。 bizarre

When I bring the content above the fold, it loads fine most of the time. There are still instances when the grey box is still showing up. The weird part is if i double-tap it, it finishes loading the content just fine. bizarre

- 更新#3 -

--Update #3--

好吧,似乎是,如果我的uiwebview高度大于1000像素,则在内容的其余部分下方会显示一个灰色框,并低于1000像素。双击显示实际内容。

Okay, so it seems to be that if my uiwebview has a height greater than 1000px, a grey box appears on the rest of the content below 1000px. A double-tap reveals the actual content.

推荐答案

在UIWebView中微调UIScrollView,

Nudging the UIScrollView in the UIWebView it fixes this for me:

[UIScrollView *webScroller= [[webView subviews] lastObject];    
[webScroller setContentOffset:CGPointMake(0,1) animated:NO];
[webScroller setContentOffset:CGPointMake(0,0) animated:NO];

这篇关于iPhone SDK - UIWebView有一个灰色框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆