详细问题描述
[内容]
设置Webview窗口背景无效,但是能够设置成透明的,设置成其他颜色实现时默认白色背景
重现步骤
[步骤]
var statusColor = "#2196f3";
var animationTypeShow = "fade-in";
var backgroundColor = "transparent";
if (app.theme == "ios") {
statusColor = "#f7f7f8";
backgroundColor = "#f7f7f8";
animationTypeShow = "pop-in";
}
var externalWebview = plus.webview.create(externalSrc, "externalWebview", {kernel: "WKWebview", background: backgroundColor, statusbar:{background: statusColor}});
// 监听页面加载完成
externalWebview.addEventListener('loaded', function(e){
plus.nativeUI.closeWaiting();
});
plus.webview.show("externalWebview", animationTypeShow);
[结果]
指定透明背景时生效,指定其他颜色时,都显示默认白色背景
[期望]
显示设置的背景色
运行环境
[系统版本]Android 8.0
联系方式
[QQ]764381220
1 个回复
DCloud_App_Array
background设置为非透明颜色,只有在Webview窗口为非全屏时才会生效,设置的是webview外面的背景颜色。如果要设置Webview的内容背景可以通过设置html中body的背景颜色。