BTAndroidWebViewSelection
BTAndroidWebViewSelection copied to clipboard
how can I set the selection color? how can I change the color?
hi..
You can do that through Javascript. I did the same way and its working quiet fine. Something like this:
JavaScript function: android.highlight.changeSelectionColor = function (colorCode) {
window.TextSelection.jsLog("JS: changeSelectionColor --> "+colorCode);
$('#selectionColor').text("::selection {background-color: "+colorCode+";}");
};
in HTML, in head TAG something like this: ""
Now whenever, you wanna change the color, call the Javascript function through the webview's method:
webview.loadUrl("javascript:android.highlight.changeSelectionColor('#ffff7b')");
See if this works for you.
Thanks