小程序
小游戏
企业微信
微信支付
扫描小程序码分享
页面做了自定义导航,且设置了扫普通二维码码进入,苹果手机偶现不显示导航栏,安卓手机一直都显示,苹果手机偶现,iPhonexs 微信版本号7.0.8
3 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
解决了吗 具体什么问题。就是因为胶囊高度没有获取到的问题吗?
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
是指home图标吗?想知道你咋写的图标的判断
导航栏的高度是固定写死的,还是动态获取的?
if (app.globalData.version < 700) {
that.setData({ isShow: false });
}else{
if (wx.getMenuButtonBoundingClientRect) {
const menuBtnObject = wx.getMenuButtonBoundingClientRect();
const statusBarHeight = wx.getSystemInfoSync().statusBarHeight;
const windowWidth = wx.getSystemInfoSync().windowWidth;
const navTop = menuBtnObject.top,
navHeight = statusBarHeight + menuBtnObject.height + (menuBtnObject.top - statusBarHeight) * 2,
navLeft = windowWidth - menuBtnObject.right,
// navWidth = menuBtnObject.left,
menuHeight = menuBtnObject.height;
that.setData({
styleName: `top: ${navTop}px;left: ${navLeft}px;height: ${menuHeight}px;width: ${menuHeight}px;`,
allBarStyleName: `top: ${navTop}px;left: ${navLeft}px;height: ${menuHeight}px;`,
navHeight,
navTop,
menuHeight
});
} else {
const navTop = 26, navLeft = 10, menuHeight = 32, navHeight = 20 + 32 + (26 - 20) * 2;
}
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
解决了吗 具体什么问题。就是因为胶囊高度没有获取到的问题吗?
是指home图标吗?想知道你咋写的图标的判断
导航栏的高度是固定写死的,还是动态获取的?
if (app.globalData.version < 700) {
that.setData({ isShow: false });
}else{
if (wx.getMenuButtonBoundingClientRect) {
const menuBtnObject = wx.getMenuButtonBoundingClientRect();
const statusBarHeight = wx.getSystemInfoSync().statusBarHeight;
const windowWidth = wx.getSystemInfoSync().windowWidth;
const navTop = menuBtnObject.top,
navHeight = statusBarHeight + menuBtnObject.height + (menuBtnObject.top - statusBarHeight) * 2,
navLeft = windowWidth - menuBtnObject.right,
// navWidth = menuBtnObject.left,
menuHeight = menuBtnObject.height;
that.setData({
styleName: `top: ${navTop}px;left: ${navLeft}px;height: ${menuHeight}px;width: ${menuHeight}px;`,
allBarStyleName: `top: ${navTop}px;left: ${navLeft}px;height: ${menuHeight}px;`,
navHeight,
navTop,
menuHeight
});
} else {
const navTop = 26, navLeft = 10, menuHeight = 32, navHeight = 20 + 32 + (26 - 20) * 2;
that.setData({
styleName: `top: ${navTop}px;left: ${navLeft}px;height: ${menuHeight}px;width: ${menuHeight}px;`,
allBarStyleName: `top: ${navTop}px;left: ${navLeft}px;height: ${menuHeight}px;`,
navHeight,
navTop,
menuHeight
});
}
}