暗眼小子
暗眼小子
  • 发布:2019-06-18 16:44
  • 更新:2021-01-13 01:10
  • 阅读:886

web-view组件如何随着页面的滚动而滚动

分类:HBuilderX

<web-view style="width: 100%; height: 100%;position: absolute;background-color: transparent;" src="/hybrid/html/local.html"></web-view>

onReady() {
// #ifdef APP-PLUS
let currentWebview = this.$mp.page.$getAppWebview();
setTimeout(function() {
let wv = currentWebview.children()[0];
wv.setStyle({top: 134, height:70, right: 0});
}, 1000);
// #endif
},

这样虽然将webview的宽高固定到理想位置,但是并不能岁页面的滚动而滚动,背景色也不能设置为透明色,尝试着设置上面的样式,最后都失败了

2019-06-18 16:44 负责人:无 分享
已邀请:
9***@qq.com

9***@qq.com

遇到同样需求, 求解

末学门丰

末学门丰 - 工作室开发者

同求

该问题目前已经被锁定, 无法添加新回复