Question

I have a UIWebView and when I press a textual link (for at least a second) some kind of UIActionSheet appears with 3 buttons (open, copy and cancel) - Is there a way to prevent it from appearing?

Thanks

Was it helpful?

Solution

You can achieve this using CSS:

* {
   -webkit-touch-callout:none;
}

OTHER TIPS

Apparently no. In the documentation, neither UIWebView nor UIWebViewDelegate expose some method or property to avoid this behavior.

 - (void)webViewDidFinishLoad:(UIWebView *)webView
  {
     [webView stringByEvaluatingJavaScriptFromString:@"document.body.style.webkitTouchCallout='none'; document.body.style.KhtmlUserSelect='none'"];
  }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top