开发者

UIWebView user interaction (click) delay

开发者 https://www.devze.com 2023-01-24 08:18 出处:网络
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.

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

精彩评论

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