android开发(36) Android WebView背景设置为透明

xml布局

<WebView
android:id="@+id/wv_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:layerType="software" />

代码里这么写

WebView mWebVew  = (WebView) findViewById(R.id.wb_content); 
// 设置背景色 
mWebView.setBackgroundColor(0); 
// 设置填充透明度
mWebView.getBackground().setAlpha(0)
原文地址:https://www.cnblogs.com/vir56k/p/3963932.html