Changing text color in a WebView?

后端 未结 8 440
梦如初夏
梦如初夏 2020-12-17 09:06

There\'s a method for altering background color but not font.
Any ideas?

8条回答
  •  时光说笑
    2020-12-17 09:36

    I had to put it in the onPageFinished method.

    _webView.setWebViewClient(new WebViewClient() {
        public void onPageFinished(WebView view, String url) {
            _webView.loadUrl(
                "javascript:document.body.style.setProperty(\"color\", \"white\");"
            );
        }
    });
    

提交回复
热议问题