主题
PageMediaData
表示页面或窗口的环境度量数据。
每当平台窗口或布局发生变化时,这些数据都会更新,例如旋转设备、调整浏览器窗口大小,或变更键盘、安全区域等系统 UI 元素时。
属性
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
padding | Padding | required | The space surrounding the entire display, accounting for system UI like notches and status bars. |
view_padding | Padding | required | Similar to padding, but includes padding that is always reserved (even when the system UI is hidden). |
view_insets | Padding | required | Areas obscured by system UI overlays, such as the on-screen keyboard or system gesture areas. |
device_pixel_ratio | float | required | The number of device pixels for each logical pixel. |
orientation | Orientation | required | The orientation of the page. |
always_use_24_hour_format | bool | False | Whether 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. |