as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
Ring
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
跳转到主要内容
useKeplerWindowDimensionsV2 returns an array of DisplayMetricsKepler entries for each surface that currently exists. DisplayMetricsVega Type:
useKeplerWindowDimensionsV2 automatically updates values when any surface’s size changes. You can get a surface window’s width and height like so:
The available array indexes depends on the number of surfaces that exist. If there is no surface the array will be empty. If there is only one surface index 0 will be that surface. If there are multiple surfaces the array will have entries for each surface. The moduleName property for each entry matches the AppRegistry name for the app component that corresponds to a surface.

Example

Properties

fontScale Vega v2

The scale of the font currently used. Some operating systems allow users to scale their font sizes larger or smaller for reading comfort. This property will let you know what is in effect. The available array indexes depends on the number of surfaces that exist.

height Vega v2

The height in pixels of the window or screen your app occupies. The available array indexes depends on the number of surfaces that exist.

scale Vega v2

The pixel ratio of the device your app is running on. The available array indexes depends on the number of surfaces that exist.
A value of 1 indicates PPI/DPI of 96 (76 on some platforms). 2 indicates a Retina or high DPI display.

width Vega v2

The width in pixels of the window or screen your app occupies. The available array indexes depends on the number of surfaces that exist.

rootTag Vega v2

The unique root tag for the surface that corresponds with this entry. The available array indexes depends on the number of surfaces that exist. Root tag will also take care of multiple instances of the same interactive component to be able to uniquely identify each instance
最后修改于 2026年10月26日