getTopHeiht(){
// 状态栏高度
let statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
// #ifdef MP-WEIXIN
// 获取微信胶囊的位置信息 width,height,top,right,left,bottom
const custom = wx.getMenuButtonBoundingClientRect();
// logo位置 = 胶囊位置 - ((logo高 - 胶囊高) / 2) + 外框的padding
this.top_height = custom.top - ((50 - custom.height) / 2) - 12;
// 导航栏高度(标题栏高度) = 胶囊高度 + (顶部距离 - 状态栏高度) * 2
// this.top_height = custom.top - custom.top / 2;
// let navigationBarHeight1 = custom.height + (custom.top - this.statusBarHeight) * 2;
// 胶囊高度
// let navigationBarHeight = custom.height;
// let jnWidth = custom.width;
// let jnTop = custom.top;
// let nRight = custom.right;
// let jnBottom = custom.bottom,
// jnHeight = custom.height;
// let jnLeft = custom.left;
// 总体高度 = 状态栏高度 + 导航栏高度
// this.navHeight = this.navigationBarHeight + this.statusBarHeight;
// #endif
}
06-18
784
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-22
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交