Android ImageMap WebKit Highlightcolor

时间:2012-04-27 13:56:30

标签: android android-ui

您好我有以下问题:

- 我正在使用ImageMap使图像的不同部分可以点击,这很好用。我正在通过WebViewClient拦截链接点击,并使用它们执行其他操作。问题是,我不希望突出显示/选择点击的区域。以下样式似乎不起作用。我已经在各种Android设备(2.2,2.3,4.0等)上测试了这个,每次点击图像区域时矩形都亮起来。有人有任何想法吗?

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
   <style>
    a{outline:none;}
    a:active{outline:none;}
    a:focus{outline:none;}
    area,area:active,area:focus {outline: none; border:0; }
    *{-webkit-tap-highlight-color:rgba(0,0,0,0);}
    </style>
  </head>
  <body>
    <img usemap="#map1" src="sourceimage" >
    <map name="map1">
     <area href="do1" alt="text1" coords="338,142,209,182"
          shape="rect">
   ...

    </map>
  </body>
</html>

2 个答案:

答案 0 :(得分:0)

我刚刚找到答案。它与html图像映射本身无关。 我忘了设置webView.setFocusableInTouchMode(false);这解决了突出选择的问题。

答案 1 :(得分:0)

这对我有用:

$("map area").on("touchend", function() {
    return false;});

根据:Removing heighlight from image map area in Android 4.x app via PhoneGap Build