通过:
wx.getSystemInfo({ success: function (res) { windowHeight = res.windowHeight console.log(res.windowHeight) } }) |
以及:
var query = wx.createSelectorQuery()query.select('.getheight').boundingClientRect()query.selectViewport().scrollOffset()query.exec(function (res) { console.log(res);}) |
方法获取到可是高度都有问题。
华为荣耀9上,
没有tabbar windowHeight高度568px;
有tabbar windowHeight返回高度562px;
没有tabbar 100vh高度显示568px;
有tabbar 100vh高度显示514px;
测试了小米手机再有tabbar的时候返回值也不对。
