处理iOS上的状态栏

时间:2018-04-08 15:16:02

标签: ios react-native wix-react-native-navigation

是否有一种goto方式来处理iOS上的状态栏?对于我的应用程序,我只希望一切都在状态栏下面..但看起来这样做的唯一方法是去每个组件并添加填充?我猜想有一种方法可以在xcode中完成它,但我没有任何线索!

谢谢!

1 个答案:

答案 0 :(得分:2)

&&

react-native中已有一个组件

您只需将其添加为

即可
<YourParentWrapper style={{flex: 1}}>
  <View style={{ height, backgroundColor }}>
        <StatusBar { ...props } />
    </View>
  // ... Your navigation or the child components
</YourParentWrapper>

高度为

Platform.OS === 'ios' ? 20 : StatusBar.currentHeight

这将在所有设备的默认状态栏下方处理您的组件