uni-app 获取可用屏幕宽度,高度
作者:互联网
let systemInfo = uni.getSystemInfoSync() // px转换到rpx的比例 let pxToRpxScale = 750 / systemInfo.windowWidth; // 状态栏的高度 let ktxStatusHeight = systemInfo.statusBarHeight * pxToRpxScale // 导航栏的高度 let navigationHeight = 44 * pxToRpxScale // window的宽度 let ktxWindowWidth = systemInfo.windowWidth * pxToRpxScale // window的高度 let ktxWindowHeight = systemInfo.windowHeight * pxToRpxScale // 屏幕的高度 let ktxScreentHeight = systemInfo.screenHeight * pxToRpxScale // 底部tabBar的高度 let tabBarHeight = ktxScreentHeight - ktxStatusHeight - navigationHeight - ktxWindowHeight
标签:windowWidth,systemInfo,app,navigationHeight,高度,pxToRpxScale,let,uni,屏幕 来源: https://www.cnblogs.com/luohang556/p/15497494.html