uni.getSystemInfoSync().windowTop
当前结果0
uni.getSystemInfoSync().screenHeight
当前结果844
uni.getSystemInfoSync().windowHeight
当前结果844

- 发布:2022-08-09 10:01
- 更新:2024-06-12 16:50
- 阅读:1101
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: macos big sur
HBuilderX类型: 正式
HBuilderX版本号: 3.5.3
手机系统: iOS
手机系统版本号: iOS 15
手机厂商: 苹果
手机机型: iphone8/ iphone13
页面类型: vue
vue版本: vue3
打包方式: 云端
项目创建方式: HBuilderX
操作步骤:
预期结果:
uni.getSystemInfoSync().windowTop
当前结果0
uni.getSystemInfoSync().screenHeight
当前结果844
uni.getSystemInfoSync().windowHeight
当前结果844
uni.getSystemInfoSync().windowTop
当前结果0
uni.getSystemInfoSync().screenHeight
当前结果844
uni.getSystemInfoSync().windowHeight
当前结果844
实际结果:
uni.getSystemInfoSync().windowTop
当前结果0
uni.getSystemInfoSync().screenHeight
当前结果844
uni.getSystemInfoSync().windowHeight
当前结果844
uni.getSystemInfoSync().windowTop
当前结果0
uni.getSystemInfoSync().screenHeight
当前结果844
uni.getSystemInfoSync().windowHeight
当前结果844
bug描述:
HBuilderX版本号: 3.5.3.20220729
编译器版本:3.5.3(vue3)
vite v2.9.14 building for development
问题:
下面现象出现在IPhone IOS15中(H5是正常的,Android未测试是否有此问题)
uni.getSystemInfoSync() 获取的 screenHeight 和 windowHeight 值一样的,windowHeight 的值未将 NavigationBar 高度去除,
分析:uni.getSystemInfoSync().windowTop 获取到的是0,而不是导航高度,可能是这个原因导致的
6 个回复
DCloud_UNI_WZF
正常讲只有在没有 NavigationBar 和 TabBar 的时候 screenHeight 和 windowHeight 才会相等
方便贴下page.json->globalStyle 的配置或提供下测试工程吗
梦学谷 (作者)
uni.getSystemInfoSync().windowTop 获取的是0,这个应该有问题
从页导致 screenHeight 和 windowHeight 才会相等
DCloud_UNI_LXH
bug 已确认,预计下版修复
DCloud_UNI_LXH
HBuilderX alpha 3.5.5 已修复
2***@qq.com
4.15 版本编写uniappx也有这个问题
沈工
我没有啊