get-window-info.md 779 字节
Newer Older
D
DCloud_LXH 已提交
1 2 3 4
## uni.getWindowInfo() @getwindowinfo

<!-- UTSAPIJSON.getWindowInfo.description -->

D
DCloud_LXH 已提交
5 6
<!-- UTSAPIJSON.getWindowInfo.compatibility -->

D
DCloud_LXH 已提交
7 8
<!-- UTSAPIJSON.getWindowInfo.param -->

D
DCloud_LXH 已提交
9
<!-- UTSAPIJSON.getWindowInfo.returnValue -->
D
DCloud_LXH 已提交
10

11
::: warning 注意事项  
DCloud_Heavensoft's avatar
DCloud_Heavensoft 已提交
12 13
- Android端的`windowHeight`属性是有时机的考量的,如果在全局作用域获取`windowHeight`,有可能当前Activity还未加载,所以导航栏和Tabbar的高度是不会计算进去的,稳妥起见,建议在`onReady`或者`onPageShow`内获取`windowheight`
- 仅iOS有安全区概念
14
:::  
taohebin@dcloud.io's avatar
taohebin@dcloud.io 已提交
15

D
DCloud_LXH 已提交
16
<!-- UTSAPIJSON.getWindowInfo.example -->
D
DCloud_LXH 已提交
17 18 19 20 21 22 23

<!-- UTSAPIJSON.getWindowInfo.tutorial -->

<!-- UTSAPIJSON.get-window-info.example -->

<!-- UTSAPIJSON.general_type.name -->

D
DCloud_LXH 已提交
24
<!-- UTSAPIJSON.general_type.param -->