【问题标题】:React Native iOS StatusBar invisible after build?React Native iOS StatusBar 在构建后不可见?
【发布时间】:2018-04-12 19:48:00
【问题描述】:

我有一个使用 Expo 编写的 React Native 项目——当我在 Expo 上开发和发布时,顶部的状态栏(时间、wifi 等)很好,我从来不用担心它-- 它一直都在,所以我从来不用读入单独的 StatusBar 组件或类似的东西。

但是当我“构建”应用程序以获取 IPA 文件然后在 TestFairy 上部署时,应用程序的状态栏是完全不可见的(不确定字体是白色还是叠加层或什么)。

有什么想法吗?谢谢!

【问题讨论】:

    标签: ios xcode reactjs react-native testfairy


    【解决方案1】:

    如世博会中提到的docs

    Expo在Android上默认将状态栏设为半透明,与iOS一致,更符合material design。

    因此使用 react-native 的 StatusBar 可以如下配置

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

    高度为Platform.OS === 'ios' ? 20 : StatusBar.currentHeight

    【讨论】:

      猜你喜欢
      • 2018-09-03
      • 2018-06-22
      • 2018-09-27
      • 2017-09-09
      • 2019-03-02
      • 2023-03-10
      • 2022-01-06
      • 1970-01-01
      • 2016-10-27
      相关资源
      最近更新 更多