UIWebView急剧滚动 [英] UIWebView scrolls jerkily

查看:88
本文介绍了UIWebView急剧滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过 UIWebView 在我的应用程序中使用包含相当多内容的网站。

I need to use a website with quite a bit of content in my App via UIWebView.

我在Mobile Safari中滚动页面,一切顺利滚动。即使我快速滚动 - 灰色方形背景出现但在片刻之后(少于0.5秒)也能正确呈现。

When I scroll the page in Mobile Safari everything scrolls smoothly. Even if I scroll fast - the grey squared background appears but is rendered properly after a few moments (less then 0.5 seconds).

UIWebView 如果快速滚动并且不显示灰色方形背景,则会急动滚动。
我猜Mobile Safari首先显示灰色方形背景并在此之后呈现,而 UIWebview 停止滚动,直到呈现的部分呈现为止。

The same page in UIWebView scrolls jerkily if scrolled fast and doesn't show the grey squared background. I guess Mobile Safari shows the grey squared background first and renders after that while UIWebview stops the scrolling until the part which will be shown is rendered.

如何告诉 UIWebView 表现得像Mobile Safari?

How to I tell UIWebView to behave like Mobile Safari?

推荐答案

它已经在它自己的自定义tilesLayer上绘制。问题是它默认情况下尝试在主线程上绘制自己,以便在无法绘制时锁定。有一条私人消息你可以打电话

It is already being drawn on it's own custom tiledLayer. The problem is that it is by default attempting to draw itself on the main thread so it locks up when I can't be drawn. There is a private message you can call


- (void)_setDrawInWebThread:(BOOL)arg1

这将起作用当你滚动太快而你无法跟上绘图时会看到空白空间直到有时间赶上来。他们使用:

That will work BUT you will see empty space when you scroll too fast and it can't keep up with the drawing until it has time to catch up. They use:


- (void)_setDrawsCheckededPattern:(BOOL)arg1

在手机游戏中为此提供帮助。

in mobile safari to help with this.

这篇关于UIWebView急剧滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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