Prevent web page from scrolling when double tap on UIWebView

1k views Asked by At

I have a UIWebView which loads a very long web page. It is the size of the screen. By default, when it receives a double tap gesture at the lower middle of the view, it scrolls down, and when it receives it at the upper middle, it scrolls up.

I have a UITapGestureRecognizer for detecting double taps attached to the view of my UIViewController. When a double tap is detected, a navigation bar appears; when another one is detected, it disappears. My problem is that, most of the time, when the user double taps for showing or hiding the navigation bar, the web page is scrolled simultaneously, which is pretty annoying.

is it possible to block this behavior on the UIWebView? Or even better, is it possible to prevent double taps from reaching the UIWebView?

Thank you.

0

There are 0 answers