getMenuButtonBoundingClientRect 部分机型获取值错误?

发布于 8 年前作者 usun14759 次浏览最后编辑 8 年前来自 issues

vivo x21 刘海屏手机

使用wx.getMenuButtonBoundingClientRect获取胶囊位置,获得top为8

所以这个值实际上是未计算statusBar高度的。但是其他手机都是计算了statusBar高度

这会导致在navigationStyle: 'custom’下实现自定义导航栏时,若依据胶囊位置定位会出错

2 回复
fugang
fugang1 楼6 年前

你好,麻烦提供出现问题的vivo x21的微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html),也提供下各个机型获取到的statusBar高度的信息截图

zhengmin
zhengmin2 楼6 年前

华为nova 2s 也出现这个问题