Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 在UIWebView中拖动_Iphone_Objective C_Uiwebview - Fatal编程技术网

Iphone 在UIWebView中拖动

Iphone 在UIWebView中拖动,iphone,objective-c,uiwebview,Iphone,Objective C,Uiwebview,有没有办法防止拖动UIWebView? 另外,有没有一种方法可以真正超越常见的UIWebView功能,例如高亮显示 希望有人能回答我 感谢阻止拖动: <script type="text/javascript" language="javascript"> document.ontouchmove = function(e) { e.preventDefault(); } </script> <style type="

有没有办法防止拖动UIWebView? 另外,有没有一种方法可以真正超越常见的UIWebView功能,例如高亮显示

希望有人能回答我


感谢阻止拖动:

<script type="text/javascript" language="javascript">

   document.ontouchmove = function(e) 
   {
          e.preventDefault(); 
   }

</script>
<style type="text/css">

    body
    {
        -webkit-user-select: none;
        -webkit-tap-highlight-color: rgba(0,0,0,0);
        -webkit-touch-callout: none;
    }

</style>

document.ontouchmove=函数(e)
{
e、 预防默认值();
}
覆盖突出显示:

<script type="text/javascript" language="javascript">

   document.ontouchmove = function(e) 
   {
          e.preventDefault(); 
   }

</script>
<style type="text/css">

    body
    {
        -webkit-user-select: none;
        -webkit-tap-highlight-color: rgba(0,0,0,0);
        -webkit-touch-callout: none;
    }

</style>

身体
{
-webkit用户选择:无;
-webkit点击高亮颜色:rgba(0,0,0,0);
-webkit触摸标注:无;
}
因此,在突出显示部分:

  • 第1行禁用选择(如文本上)
  • 第二行禁用实际高亮显示
  • 第三个选项禁用当您按下图像2秒时看到的“弹出窗口”,询问您是否要下载/保存
保留你需要的


希望这有帮助:)

防止拖动:

<script type="text/javascript" language="javascript">

   document.ontouchmove = function(e) 
   {
          e.preventDefault(); 
   }

</script>
<style type="text/css">

    body
    {
        -webkit-user-select: none;
        -webkit-tap-highlight-color: rgba(0,0,0,0);
        -webkit-touch-callout: none;
    }

</style>

document.ontouchmove=函数(e)
{
e、 预防默认值();
}
覆盖突出显示:

<script type="text/javascript" language="javascript">

   document.ontouchmove = function(e) 
   {
          e.preventDefault(); 
   }

</script>
<style type="text/css">

    body
    {
        -webkit-user-select: none;
        -webkit-tap-highlight-color: rgba(0,0,0,0);
        -webkit-touch-callout: none;
    }

</style>

身体
{
-webkit用户选择:无;
-webkit点击高亮颜色:rgba(0,0,0,0);
-webkit触摸标注:无;
}
因此,在突出显示部分:

  • 第1行禁用选择(如文本上)
  • 第二行禁用实际高亮显示
  • 第三个选项禁用当您按下图像2秒时看到的“弹出窗口”,询问您是否要下载/保存
保留你需要的


希望这有帮助:)

您可以使用以下代码查找webView的滚动视图并禁用滚动:

UIScrollView *scrollView = nil;
for(UIView *aView in webView.subviews){
    if([aView isKindOfClass:[UIScrollView class] ]){
        scrollView = (UIScrollView *)aView;
        scrollView.scrollEnabled = NO;
        scrollView.bounces = NO;
    }
}   

您可以使用以下代码查找webView的scrollView并禁用滚动:

UIScrollView *scrollView = nil;
for(UIView *aView in webView.subviews){
    if([aView isKindOfClass:[UIScrollView class] ]){
        scrollView = (UIScrollView *)aView;
        scrollView.scrollEnabled = NO;
        scrollView.bounces = NO;
    }
}   

这正是我需要的,这正是我需要的。