How can text selection be disabled in Android 3.0 Honeycomb?

不想你离开。 提交于 2019-12-11 15:25:37

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!