as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
Ring
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
原生
Skip to main content
useKeplerWindowDimensions returns an array of DisplayMetricsKepler entries for each surface that currently exists. DisplayMetricsKepler Type:
useKeplerWindowDimensions automatically updates values when any surface’s size changes. To get a surface window’s width and height use the width and height properties:
The available array indexes depends on the number of surfaces that exist. If there is no surface the array is empty. If there is only one surface, the index for that surface is zero (0). If there are multiple surfaces, the array has an entry 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

The scale of the font currently used. Some operating systems allow users to scale their font sizes larger or smaller for reading comfort. This prop allows you to determin what the current font scale is. The available array indexes depends on the number of surfaces that exist.

height

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

scale

The pixel ratio of the device that 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

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

moduleName

The name of the module for the surface that corresponds with this entry. The available array indexes depends on the number of surfaces that exist.
最后修改于 2026年10月26日