Home » Android » android – Change Background color and font color

android – Change Background color and font color

Posted by: admin June 15, 2020 Leave a comment


I want to change my WebView‘s background color and font size.

How to&Answers:

Assuming that you have defined your webview in an XML layout resource you can do the following:

WebView myWebView = (WebView) findViewById(R.id.myWebView);

You may also want to enable javascript and create a simple WebClient to handle page loading

Hope it helps!


You could call some javascript that would modify the CSS of the loaded page.


I would think you can’t – unless you control the html data displayed.

The font and background are controlled by the html data feed to the Webview and not the Webview itself.