在app.js中加入

//获取手机statusBarHeight的高度


getapp: function() {
const self = this
wx.getSystemInfo({
success: res => {
//导航高度
this.globalData.navHeight = res.statusBarHeight;
this.globalData.winHeight = res.windowHeight;
if (res.statusBarHeight > 20) {
self.isIPX = true;
} else {
self.isIPX = false;
}
},
fail(err) {
console.log(err);
}
})
},

//需要调整高度的页面

const app = getApp();
//判断app.isIPX
if(app.isIPX){
  //需要添加的 class
  //然后页面通过class 去改变css 底部高度
}

 

相关文章:

  • 2021-08-30
  • 2022-01-15
  • 2021-04-10
  • 2021-11-17
  • 2021-04-14
  • 2021-12-24
  • 2021-11-20
猜你喜欢
  • 2021-12-21
  • 2021-12-02
  • 2021-04-21
  • 2021-11-27
  • 2021-12-04
  • 2021-04-30
相关资源
相似解决方案