Reputation: 235
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;
}
And:
<body style='-webkit-user-select:none;'>
Nothing seems to work on iOS 4.3 - has anyone else had problems with this?
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?
Thanks, AggroPanda
Upvotes: 5
Views: 4520
Reputation: 13258
I am having the same problem, but also a solution. Put this into your JavaScript code:
document.documentElement.style.webkitTouchCallout = "none";
It works in iOS 4.3. on an iPad. No idea why the CSS does not work in some iOS versions.
Upvotes: 4