//事件处理函数
  onLoad: function (options) {
    const res = wx.getSystemInfoSync()
    var statusbarH = res.statusBarHeight
    this.setData({
        statusbar :statusbarH, // 状态栏高度
        jiaonangheight: wx.getMenuButtonBoundingClientRect().height  // 胶囊高度
    })
    
    console.log(wx.getMenuButtonBoundingClientRect(), '胶囊属性');
   
  },

 

 

需要在data中定义statusbar和jiaonangheight

 

相关文章:

  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2021-10-03
  • 2021-06-18
  • 2022-12-23
  • 2021-08-13
  • 2022-12-23
猜你喜欢
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2021-11-14
相关资源
相似解决方案