tabBar设置隐藏后仍然占位
设置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都不占位,但是个别手机中,顶部会有空白占位(下图蓝色框的部分):
有问题的测试机信息为:
