开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜