iOS 4.3 UIWebView -webkit-user-select:none;问题 [英] iOS 4.3 UIWebView -webkit-user-select:none; Problem

查看:132
本文介绍了iOS 4.3 UIWebView -webkit-user-select:none;问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在开发一个iPad应用程序,它使用UIWebView显示一些效果很好的文本和图像数据。但是,我正在尝试停止用户按住屏幕几秒钟时发生的用户选择。除了iOS 4.3之外,通常的方法似乎都可以正常工作。

I've been developing an iPad application that uses UIWebView to display some text and image data which is working great. However, I'm trying to stop the user selection that occurs when the user hold the screen for a couple of seconds. The usual methods seem to work fine on everything other than iOS 4.3.

我尝试了几个不同的东西,例如:

I've tried a couple of different things such as:

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

并且:

<body style='-webkit-user-select:none;'>

在iOS 4.3上似乎没什么用 - 有其他人有这个问题吗?

Nothing seems to work on iOS 4.3 - has anyone else had problems with this?

我已经做了一些挖掘,发现一些关于UIWebView Nitro Engine在iOS 4.3中有所不同 - 这是否会导致问题?

I've done a bit of digging and found something about the UIWebView Nitro Engine being different in iOS 4.3 - could this be causing the problem?

谢谢,
AggroPanda

Thanks, AggroPanda

推荐答案

我遇到了同样的问题,但也是一个解决方案。将它放入您的JavaScript代码中:

I am having the same problem, but also a solution. Put this into your JavaScript code:

document.documentElement.style.webkitTouchCallout = "none";

适用于iOS 4.3。在iPad上不知道为什么CSS在某些iOS版本中不起作用。

It works in iOS 4.3. on an iPad. No idea why the CSS does not work in some iOS versions.

这篇关于iOS 4.3 UIWebView -webkit-user-select:none;问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆