开发者

UIWebView user interaction (click) delay

whenever I make a tap action o开发者_StackOverflow中文版n a UIWebView, for example clicking a link, there is a slightly delay between the tap and the actual highlighting / activating of the link.

Is there a way to disable this delay?

I've read that this would be possible in UIScrollView with

setDelaysContentTouches:NO

Is this also possible in UIWebViews?


This is the solution I used:

http://cubiq.org/remove-onclick-delay-on-webkit-for-iphone


In iOS5 the UIScrollView belonging to a UIWebView has been exposed so that you can change its behavior. So to remove the click delays you can simply do:

[webView.scrollView setDelaysContentTouches:NO]

As a bonus, you can make the scrolling in a UIWebView feel a bit more native by changing the decelerationRate:

[webView.scrollView setDecelerationRate:UIScrollViewDecelerationRateNormal]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜