简体   繁体   English

iphone sdk:如何摆脱UIWebView中的操作表?

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

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? 我有一个UIWebView,当我按下文本链接(至少一秒钟)时,某种UIActionSheet会出现3个按钮(打开,复制和取消) - 有没有办法防止它出现?

Thanks 谢谢

You can achieve this using CSS: 您可以使用CSS实现此目的:

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

Apparently no. 显然没有。 In the documentation, neither UIWebView nor UIWebViewDelegate expose some method or property to avoid this behavior. 在文档中,UIWebView和UIWebViewDelegate都没有公开某些方法或属性来避免这种行为。

 - (void)webViewDidFinishLoad:(UIWebView *)webView
  {
     [webView stringByEvaluatingJavaScriptFromString:@"document.body.style.webkitTouchCallout='none'; document.body.style.KhtmlUserSelect='none'"];
  }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM