wx.getMenuButtonBoundingClientRect 部分机型无
发布于 4 年前 作者 yguo 2267 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图)
  • 预期表现
  • 复现路径

使用的是自定义导航,部分机型会出现这种情况,没有渠道system或者胶囊的值(真机表现)

  • 提供一个最简复现 Demo

onLaunch: function(options) {

// 获取系统状态栏信息

wx.getSystemInfo({

success: e => {

this.globalData.StatusBar = e.statusBarHeight;

let custom = wx.getMenuButtonBoundingClientRect();

this.globalData.Custom = custom;

this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight;

this.globalData.ScreenHeight = e.screenHeight;

this.globalData.ScreenWidth = e.screenWidth

}

});

})

3 回复

你好,我这样直接提示wx.getMenuButtonBoundingClientRect is not a function是什么鬼啊?

你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

我今天也发现了一个问题,iOS在游戏开始的时候获取胶囊信息的时候返的数据是错的!在一段时间后再获取就没问题了

回到顶部