蘋果適配
- SafeAreaView是react-native提供的組件(0.50.1推出)
- 僅 iOS 11 或更高版本
- 低版本不需要適配,因?yàn)閕Phone X ( 出廠就是11或以上的系統(tǒng) ) 才出現(xiàn)劉海屏
使用方式
<SafeAreaView style={{flex: 1, backgroundColor: 'white'}}>
<View style={{ flex: 1 }}>
<Text>Hello World!</Text>
</View>
</SafeAreaView>
安卓適配
方案1
使用方式
<meta-data android:name="android.max_aspect" android:value="2.1" />