如何在iPhone的UIWebview中禁用lonpress?

如何在iPhone的UIWebview中禁用lonpress?,iphone,html,uiwebview,Iphone,Html,Uiwebview,我正在使用UIWebview显示local.html。我想在此视图中禁用longpress。我将如何执行此操作 下面是修复它的方法: <style media="screen" type="text/css"> body { -webkit-touch-callout: none; } </style> 身体{ -webkit触摸标注:无; } 将此添加到CSS中: body { -webkit-touch-callout: none; } 您还可以通过调

我正在使用UIWebview显示local.html。我想在此视图中禁用longpress。我将如何执行此操作

下面是修复它的方法:

<style media="screen" type="text/css">

body {
  -webkit-touch-callout: none;
}
</style>

身体{
-webkit触摸标注:无;
}
将此添加到CSS中:

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

您还可以通过调用以下命令来修复不受控制的页面:

[webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout = \"none\";"];
UIWebViewDelegate
方法:

-(void)webViewDidFinishLoad:(UIWebView *)webView

谢谢,我也试过类似的方法,但这次成功了。