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)
本文介绍如何在Android中使用WebView,并将其背景设为完全透明的方法。通过XML布局文件配置WebView属性,以及在Java代码中进一步调整透明度。

1164

被折叠的 条评论
为什么被折叠?



