Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable long press gesture on UIWebView of iOS

Tags:

ios

uiwebview

I'm just wondering how to disable the long press gesture on webview in iOS. I need to disable only long press gesture not others. should work on iOS 5.0 + thank you

like image 688
Seung Hyun Sean Lee Avatar asked Oct 22 '25 16:10

Seung Hyun Sean Lee


2 Answers

I want to thank all for help. I finally found the solution after intensive stackoverflow research. For help other :

In the javascript/html, you can avoid dealing with the longpress event.

The solution was given long time ago : Preventing default context menu on longpress / longclick in mobile Safari (iPad / iPhone)

I did it and it is just perfect. Thanks and thanks again.

JM

like image 151
IneoScan Avatar answered Oct 25 '25 04:10

IneoScan


You could make UIWebView as a super class to one of your custom class, extend it.. and override touchesBegan.. methods from UIView class..

like image 40
chuthan20 Avatar answered Oct 25 '25 05:10

chuthan20



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!