开发者

iphone sdk: How to get rid of the action sheet in UIWebView?

开发者 https://www.devze.com 2022-12-16 00:18 出处:网络
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 ap

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'"];
  }
0

精彩评论

暂无评论...
验证码 换一张
取 消