【问题标题】:Can I remove Android default link styling in webview我可以在 webview 中删除 Android 默认链接样式吗
【发布时间】:2011-03-23 13:08:05
【问题描述】:

当您在 Android 浏览器中单击链接时,默认情况下目标链接区域会以橙色框突出显示。然后长按打开链接处理的上下文菜单(复制、粘贴、新窗口等)。有没有办法在 webview 中禁用其中一个/两个?我在 scriptaculous 中使用highlight code,默认的 android 链接样式被覆盖在效果之上。

【问题讨论】:

    标签: android webview


    【解决方案1】:

    这可能有用:How to Hide Android WebView Highlight Border

    答案是:添加这个 CSS * { -webkit-tap-highlight-color: rgba(0, 0, 0, 0); }

    希望如此。

    【讨论】:

    • 完全正确!非常感谢。我在这里粘贴 CSS 以防万一该网站消失。 * {-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}
    • @EnthuDeveloper 它是 css - 所以要么在页面的 css 文件中,要么在页面本身的样式标签中。
    【解决方案2】:

    建议的解决方案将颜色设置为透明黑色:

    * {
      -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    }
    

    只需将颜色指定为transparent 即可:

    * {
      -webkit-tap-highlight-color: transparent;
    }
    

    【讨论】:

    • 刚刚测试过(android 2.3.4),它没有。您无法更改突出显示的颜色,只能使其消失。为此,您必须使用 rgba(X,X,X,0) 语法。
    猜你喜欢
    • 1970-01-01
    • 2014-04-15
    • 1970-01-01
    • 2011-07-26
    • 2019-01-19
    • 2022-11-27
    • 1970-01-01
    • 1970-01-01
    • 2013-03-11
    相关资源
    最近更新 更多