Skip to content

PageMediaData

表示页面或窗口的环境度量数据。

每当平台窗口或布局发生变化时,这些数据都会更新,例如旋转设备、调整浏览器窗口大小,或变更键盘、安全区域等系统 UI 元素时。

属性 ​

名称类型默认值说明
paddingPaddingrequiredThe space surrounding the entire display, accounting for system UI like notches and status bars.
view_paddingPaddingrequiredSimilar to padding, but includes padding that is always reserved (even when the system UI is hidden).
view_insetsPaddingrequiredAreas obscured by system UI overlays, such as the on-screen keyboard or system gesture areas.
device_pixel_ratiofloatrequiredThe number of device pixels for each logical pixel.
orientationOrientationrequiredThe orientation of the page.
always_use_24_hour_formatboolFalseWhether to use 24-hour format when formatting time. Note: The behavior of this flag is different across platforms: - On Android this flag is reported directly from the user settings called "Use 24-hour format". It applies to any locale used by the application, whether it is the system-wide locale, or the custom locale set by the application. - On iOS this flag is set to true when the user setting called "24-Hour Time" is set or the system-wide locale's default uses 24-hour formatting.

关注我,学习大模型、大数据、Python等热门技术。