1***@qq.com
1***@qq.com
  • 发布:2018-03-08 11:48
  • 更新:2018-03-08 12:38
  • 阅读:1703

怎么关闭新创建的子webview

分类:HBuilder

这样子创建的一个webview,是地图上的一个小控件,现在当前页面关闭这个新创建的webview
var wsub = plus.webview.create('maps_map_sub.html', 'sub', {
bottom:"0px",
// top: topoffset,
height: "60px",
position: 'absolute',
scrollIndicator: 'none',
background: 'transparent'
});
ws.append(wsub);var wsub = plus.webview.create('maps_map_sub.html', 'sub', {
bottom:"0px",
// top: topoffset,
height: "60px",
position: 'absolute',
scrollIndicator: 'none',
background: 'transparent'
});
ws.append(wsub);
但是我在移除这个view的时候无效
var sdaaaa=plus.webview.getWebviewById("sub");
ws.remove(sdaaaa)
想问一下改怎么移除子webview

2018-03-08 11:48 负责人:无 分享
已邀请:
hylong

hylong

仔细阅读remove
移除后子Webview窗口不会关闭,需要调用其close方法才能真正关闭并销毁。

如果你只是想显示,隐藏子webview,可以用show,hide。如果用remove,需要同时调用close

  • 1***@qq.com (作者)

    嗯,好的,非常感谢,后来发现了,那个close的我搞错了

    2018-03-08 13:53

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