I have a UIWebView and when I press a tex开发者_Go百科tual 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
You can achieve this using CSS:
* {
-webkit-touch-callout:none;
}
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'"];
}
精彩评论