package com.example.webviewtheme;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.webkit.WebView;
public class MainActivity extends Activity {
WebView webview1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
webview1=(WebView)findViewById(R.id.webView1);
String rawHTML = "<HTML>"+
"<body style='color: #000000; background-color: #ffffff'><h1>Hello Android </h1></body>"+
"</HTML>";
webview1.setBackgroundColor(00000000);
webview1.loadData(rawHTML, "text/HTML", "UTF-8");
}
}
這是我的代碼要設置web視圖的背景顏色黑文白我試圖適用於HTML,但不能出去放,請幫助我如何設置夜間模式在網頁視圖文本和背景如何設置背景顏色黑色和機器人的WebView文白
嘗試這些鏈接[Link](http://stackoverflow.com/questions/11225296/how-set-text-color-of-webview-in-android)和[Link](http://stackoverflow.com /問題1 ons/1254970/change-text-color-in-a-webview)和[Link](http://stackoverflow.com/questions/3389446/android-webview-changing-backcolor-and-font-color) – vish