html5plus
項目是用HTML5+開發(fā)的,嵌入另一個項目已經完成的頁面,用iframe來完成的。但是在ios端出現不兼容問題,然后就用這個plus.webview.create
來解決
openWebUrl(url, title) {
let webview = plus.webview.create(url);
webview.setStyle({
titleNView: {
titleText: title,
autoBackButton: false,
backgroundColor: "#FFFFFF",
titleSize: "14px",
height: "48px",
tags: [{
tag: 'rect',
id: 'rect',
color: '#e5e5e5',
position: {
bottom: '0px',
left: '0px',
width: '100%',
height: '1px'
}
}, ],
buttons: [{
type: "back",
float: "left",
onclick: function() {
webview.canBack(function(e) {
if (e.canBack) //是否可以返回
{
webview.back();
} else {
webview.close()
}
})
}
}]
},
});
webview.show();
},