// 获取系统信息
const systemInfo = wx.getSystemInfoSync();
// 胶囊按钮位置信息
const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
// 导航栏高度 = 状态栏到胶囊的间距(胶囊距上距离-状态栏高度) * 2 + 胶囊高度 + 状态栏高度
var navBarHeight = (menuButtonInfo.top - systemInfo.statusBarHeight) * 2 + menuButtonInfo.height + systemInfo.statusBarHeight;
var menuRight = systemInfo.screenWidth - menuButtonInfo.right;
var menuBotton = menuButtonInfo.top - systemInfo.statusBarHeight;
var menuHeight = menuButtonInfo.height;
var sysHeight=systemInfo.statusBarHeight
小程序导航自定义
最新推荐文章于 2024-08-19 20:48:55 发布