🗑️ SafeAreaView
请改用 react-native-safe-area-context。
¥Use react-native-safe-area-context instead.
SafeAreaView
的目的是在设备的安全区域边界内渲染内容。目前仅适用于 iOS 版本 11 或更高版本的 iOS 设备。
¥The purpose of SafeAreaView
is to render content within the safe area boundaries of a device. It is currently only applicable to iOS devices with iOS version 11 or later.
SafeAreaView
渲染嵌套内容并自动应用填充来反映视图中未被导航栏、选项卡栏、工具栏和其他祖级视图覆盖的部分。此外,最重要的是,Safe Area 的填充反映了屏幕的物理限制,例如圆角或相机凹口(即 iPhone 13 上的传感器外壳区域)。
¥SafeAreaView
renders nested content and automatically applies padding to reflect the portion of the view that is not covered by navigation bars, tab bars, toolbars, and other ancestor views. Moreover, and most importantly, Safe Area's paddings reflect the physical limitation of the screen, such as rounded corners or camera notches (i.e. the sensor housing area on iPhone 13).
示例
¥Example
使用时,请使用 SafeAreaView
封装你的顶层视图,并应用 flex: 1
样式。你可能还想使用与你的应用设计相匹配的背景颜色。
¥To use, wrap your top level view with a SafeAreaView
with a flex: 1
style applied to it. You may also want to use a background color that matches your application's design.
参考
¥Reference
属性
¥Props
视图属性
继承 视图属性。
¥Inherits View Props.