是否有一种 goto 方式来处理 iOS 上的状态栏?对于我的应用程序,我只希望所有内容都在状态栏下方。但看起来唯一的方法是转到每个组件并添加填充?我想在 xcode 中有一种方法可以做到这一点,但我不知道!
谢谢!
最佳答案
react-native
中已经有一个组件用于 StatusBar
你只需要将它添加为
<YourParentWrapper style={{flex: 1}}>
<View style={{ height, backgroundColor }}>
<StatusBar { ...props } />
</View>
// ... Your navigation or the child components
</YourParentWrapper>
高度在哪里
Platform.OS === 'ios' ? 20 : StatusBar.currentHeight
这将在所有设备的默认状态栏下方处理您的组件
关于ios - 处理 iOS 上的状态栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49719391/