问题
This simple test page has the snippet that typically suppresses text selection on Android, iOS, Chrome, Safari and Firefox:
.unselectable {
-moz-user-select: none;
-webkit-user-select: none;
}
I have a lot of test devices and I've been able to confirm that this suppresses text selection on the Android 2.X devices, but fails to do so on a Xoom running Android 3.0 Honeycomb.
So:
- Is this a Honeycomb-specific problem or a Xoom-specific problem?
- Is there a hack for a fix now or a fix coming down the Android pipeline?
回答1:
The selecting logic has been rewritten for 3.0 so I guess they have either missed respecting this attribute or simply chose to ignore it (the user will get confused if he can select text on one page but not on another one).
Try writing a bug report on http://code.google.com/p/android/issues/list
回答2:
I don't think this is true for all different Android phones. I've got 2.2 on my HTC Desire, and -webkit-user-select: none has no effect at all. It's really annoying, but it's true.
来源:https://stackoverflow.com/questions/5759585/how-can-text-selection-be-disabled-in-android-3-0-honeycomb