🗑️ SafeAreaView
已弃用
SafeAreaView会自动根据系统的各种导航栏、工具栏等预留出空间来渲染内部内容。更重要的是,它还会考虑到设备屏幕的局限,比如屏幕四周的圆角或是顶部中间不可显示的“刘海”区域。
示例
只需简单地把你原有的视图用SafeAreaView包起来,同时设置一个flex: 1的样式。当然可能还需要一些和你的设计相匹配的背景色。
文档
Props
View Props
继承了所有的View Props.
As padding is used to implement the behavior of the component, padding rules in styles applied to a
SafeAreaViewwill be ignored and can cause different results depending on the platform. See #22211 for details.
emulateUnlessSupported
| 类型 | Required | Default |
|---|---|---|
| bool | No | true |