一开始设置网页的背景透明色都不奏效,方向有问题。后来谷歌发现可以设置 WebView的背景色及透明度来实现。
WebView webview=new WebView();
webview.setBackgroundColor(0); // 设置背景色
webview.getBackground().setAlpha(0); // 设置填充透明度 范围:0-255
一开始设置网页的背景透明色都不奏效,方向有问题。后来谷歌发现可以设置 WebView的背景色及透明度来实现。
WebView webview=new WebView();
webview.setBackgroundColor(0); // 设置背景色
webview.getBackground().setAlpha(0); // 设置填充透明度 范围:0-255
本文标题:WebView设置背景透明
本文链接:https://www.haomeiwen.com/subject/tcfclctx.html
网友评论