ios - 处理 iOS 上的状态栏

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

是否有一种 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/

相关文章:

ios - 有没有办法在 React Native for iOS 中获取唯一的设备 ID?

android - react-native run-android 命令失败

react-native - 使用 setRoot 或 push in react native 导航时渲染 flash

ios - Swift 2.1 Core Data - 保存具有一对多关系的数据,但如果已经存在则不添加 isome 数据

ios - Xcode 9 borderColor 在用户定义的运行时属性中不起作用

javascript - Firebase onAuthStateChanged 和 Redux 状态

react-native - WIX react native 导航 : Second screen in stack displays over the first one

javascript - React Native Navigation (6.3.2) - 如何在 Android 中完全隐藏顶部状态栏(见屏幕截图)

ios - 无法在 Swift 框架中导入 Common Crypto

ios - 使用 AVAsset/AVCaptureSession 裁剪视频