使用此代码的Ext js和cordova插件
console.log(getBgPicture);
编码图像正确获取。
setBodyStyle('background:url("'+'data:image/jpeg;base64,'+getBgPicture +'") no-repeat center; background-size: cover');
执行过程中将出现此错误
app.js:1 GET data:image / jpeg net :: ERR_INVALID_URL
我尝试了很多方法。如果有人知道,请告诉我。在此先感谢
您应该将参数setBodyStyle
作为对象与camelCase
参数一起使用。
this.setBodyStyle({
backgroundImage: "url('data:image/jpeg;base64," + getBgPicture + "')",
backgroundRepeat: "no-repeat",
backgroundSize: "cover",
backgroundPosition: "center"
});