Change Background color and font color

14,293

Solution 1

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

WebView myWebView = (WebView) findViewById(R.id.myWebView);
myWebView.setBackgroundColor(Color.parseColor("#000000"));
myWebView.getSettings.setDefaultFontSize(10);

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

Hope it helps!

Solution 2

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

Share:
14,293

Related videos on Youtube

zayar
Author by

zayar

Updated on June 04, 2022

Comments

  • zayar
    zayar about 2 years

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

  • jagsaund
    jagsaund almost 14 years
    I didn't see any thing regarding changing font color in the API documentation. I don't think it's possible.