Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIWebView user interaction (click) delay

whenever I make a tap action on 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?

like image 864
Elias Avatar asked Dec 29 '22 05:12

Elias


2 Answers

This is the solution I used:

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

like image 179
TomSwift Avatar answered Dec 30 '22 19:12

TomSwift


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]
like image 21
reekris Avatar answered Dec 30 '22 19:12

reekris