可以通过uni.getSystemInfoSync()获取系统信息中的menuButtonBoundingClientRect属性来获取胶囊的高度。具体代码示例如下:

let res = uni.getSystemInfoSync();
let menuButtonRect = res.menuButtonBoundingClientRect;
let capsuleHeight = menuButtonRect.height;
console.log("胶囊高度:" + capsuleHeight);
uniapp开发微信小程序如何获取胶囊的高度

原文地址: https://www.cveoy.top/t/topic/bilg 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录