Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
214 views
in Technique[技术] by (71.8m points)

android - Changing text color in a WebView?

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

something like

String text = "<html><head>"
          + "<style type="text/css">body{color: #fff; background-color: #000;}"
          + "</style></head>"
          + "<body>"                          
          + your_string_text_here
          + "</body></html>";

webview1.loadData(text, "text/html", "utf-8");

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...