Android webview change highlight color of the link
I need to change the default selection color of the link in Android webview. Going through the few questions in the stack overflow didn't help me . Below question answer how to remo开发者_如何学运维ve it. I want to just change the color from orange to e.g. red. Android browser GREEN border on click
Can some one help me out ?
If you don't mind getting jQuery involved (I never do), first add this:
* {
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
Then use the touchstart
or touchend
commands like this:
$("li").bind('touchstart', function(){
$(this).css("border","1px solid green");
setTimeout("$('li').css('border','none')",1500);
});
You can't change it in WebView. You can however read the data as a string, replace all a tags by (lt)font color="#0000FF"(gt)(lt)a (and change the /a tags accordingly) and then load the string in WebView with webView.loadData(String string ..).
精彩评论