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都不占位,但是个别手机中,顶部会有空白占位(下图蓝色框的部分): [图片] 有问题的测试机信息为: [图片] [图片]