tabBar设置隐藏后仍然占位
发布于 5 年前 作者 taodu 11491 次浏览 来自 问答

设置tabbar,position为top:

"tabBar": {
    "borderStyle": "white",
    "backgroundColor": "#ffffff",
    "position": "top",
    "list": [
      {
        "pagePath": "pages/index/index"
      },
      {
        "pagePath": "pages/index/map"
      },
      {
        "pagePath": "pages/team/index"
      },
      {
        "pagePath": "pages/mine/index"
      }
    ]
  }

在app.js的onLaunch方法中隐藏掉tabbar:

onLaunch: function(options) {
    // Do something initial when launch.
    var that = this;
    wx.hideTabBar()
    wx.getSystemInfo({
      success: function(res) {
        var model = res.model;
        if (res.system.indexOf('iOS') > -1) {
          that.globalData.isiOS = true
        }
 
        if (model.indexOf('iPhone X') > -1) {
          that.globalData.isIpx = true
        }
      }
    })
  },

在大部分手机中,tabbar都不占位,但是个别手机中,顶部会有空白占位(下图蓝色框的部分):

有问题的测试机信息为:

3 回复

提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

也出现了这个问题, iphone 7  微信版本:6.7.0 

在oppo a73上的运行效果截图:

回到顶部