uni.getWindowInfo获取到的windowHeight 还有safeArea信息乱七八糟,都是错的,难道官方没测试?还是说官方测试的都是对的?
HB版本4.57
附件截图1是我的Android模拟器,截图2是官方api文档的说明。
我获取到的信息如下,windowHeight=924是咋算出来的?还有这safeArea.bottom=0,Android底部安全区咋算的?
"safeArea":
{
"bottom":0,
"height":-52,
"left":0,
"right":0,
"top":52,
"width":0
},
"safeAreaInsets":
{
"bottom":0,
"left":0,
"right":0,
"top":52
},
"screenHeight":998,
"screenWidth":448,
"statusBarHeight":52,
"windowBottom":0,
"windowHeight":924,
"windowTop":0,
"windowWidth":0
}

- 发布:2025-07-21 15:30
- 更新:2025-07-22 19:45
- 阅读:45



DCloud_UNI_OttoJi - 日常回复 uni-app/x 问题,如果艾特我没看到,请主动私信
可能是模拟器差异,请使用真机测试,我复测安卓小米 13 返回值正常。
{"cutoutArea":[{"bottom":38,"left":184,"right":209,"top":0}],"pixelRatio":2.75,"safeArea":{"bottom":857,"height":819,"left":0,"right":393,"top":38,"width":393},"safeAreaInsets":{"bottom":16,"left":0,"right":0,"top":38},"screenHeight":873,"screenTop":0,"screenWidth":393,"statusBarHeight":38,"windowBottom":0,"windowHeight":791,"windowTop":0,"windowWidth":393}