鸿蒙5.0 - uni-app uni.getSystemInfo 获取的 safearea 不一致问题
鸿蒙5.0 - uni-app uni.getSystemInfo 获取的 safearea 不一致问题
开发环境 | 版本号 | 项目创建方式 |
---|---|---|
Mac | 15.2 | CLI |
操作步骤:
"safeAreaInsets": {
"top": 35,
"bottom": 28,
"left": 0,
"right": 0
}
但具体到某个页面,再通过 uni.getSystemInfoSync 获取时,safeAreaInsets.bottom
变为0了,类似如下:
"safeAreaInsets": {
"top": 0,
"bottom": 0,
"left": 0,
"right": 0
}
预期结果:
前后值一致
实际结果:
前后值不一致
bug描述:
"safeAreaInsets": {
"top": 35,
"bottom": 28,
"left": 0,
"right": 0
}
但具体到某个页面,再通过 uni.getSystemInfoSync 获取时,safeAreaInsets.bottom
变为0了,类似如下:
"safeAreaInsets": {
"top": 0,
"bottom": 0,
"left": 0,
"right": 0
}
更多关于鸿蒙5.0 - uni-app uni.getSystemInfo 获取的 safearea 不一致问题的实战教程也可以访问 https://www.itying.com/category-93-b0.html
1 回复
更多关于鸿蒙5.0 - uni-app uni.getSystemInfo 获取的 safearea 不一致问题的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
正常表现,safeAreaInsets是安全区域和用户布局主体区域交叉的部分。在没有页面时,这个数值是正确的