WebView設置背景色

項目中用到一個webview加載一個html,後始終圖片周圍有白色空隙,影響用戶體驗,通過普遍查找資料後得出結論:在代碼中設置背景和透明度就能夠了。我暈!記錄一下,但願朋友們不要犯跟我同樣的錯誤。html

mWebView.setBackgroundColor(0); // 設置背景色 
  mWebView.getBackground().setAlpha(0); // 設置填充透明度 範圍:0-255 

親測能夠,你們能夠驗證一下!web