how set text color of webview in android

后端 未结 4 844
情歌与酒
情歌与酒 2021-01-13 06:57

i am trying to change text color of webview with this code

String message =\"\"+\"\"+
\"text in white\"+ \"
\"
4条回答
  •  猫巷女王i
    2021-01-13 07:50

    In order to change a WebView’s background color there is a standard way:

    mWebView.setBackgroundColor(Color.Black);
    

    In order to change a WebView’s text font color there is no standard way: Either you change the font through the html code, or you do this:

    htmlData="" + htmlData + "";
    mWebView.loadDataWithBaseURL(null, htmlData, "text/html", "UTF-8", null);
    

提交回复
热议问题