Comments (2)
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:
"<style id="selectionColor"> ::selection{background-color: #98d9f1;} </style>"
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.
from btandroidwebviewselection.
Thanks
from btandroidwebviewselection.
Related Issues (20)
- cursor not visible with gingerbread. HOT 6
- getting the html source from the selection HOT 7
- Selection in webview after zoom and get the selected word using js?
- jquery is not working when loading dynamically HOT 3
- Selection doesn't work on Samsung Galaxy S2 (Android 4.1.2) HOT 1
- Add support for localization HOT 2
- Select text in complext web pages HOT 1
- License? HOT 1
- Not working as the data loaded from a web address.
- Not Properly working in Android KItkat HOT 3
- Not working on Galaxy S3
- Selection not working on Samsung Galaxy Tab2 HOT 5
- load Data method is not working HOT 2
- Arabic font problam HOT 1
- Selection works Very Slow
- Selection Problem on using loadDataWithBaseURL to load data HOT 2
- I dont know how to use BTAndroidWebView i tried BTWebView bt=new BTWebView(this); HOT 4
- CAB comes up context menu as well in lollipop device HOT 2
- Javascript call from WebView to Android and Vice Versa HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from btandroidwebviewselection.