【问题标题】:React native status bar background color not set未设置反应本机状态栏背景颜色
【发布时间】:2016-08-14 06:20:16
【问题描述】:

我正在尝试在 renderSectionHeader 函数中设置状态栏导航背景色:

renderSectionHeader() {
    return (
        <View>
            <StatusBar
              backgroundColor="purple"
              barStyle="light-content"
            />
            <View style={styles.header}>
                <Text style={styles.headerTitle}>Company</Text>
            </View>
        </View>
    )
}

首先,它似乎不是设置StatusBar 属性的正确位置。 barStyle 属性虽然有效,但未设置 backgroundColor。它是透明的,实际问题是在状态栏后面滚动的ListView。在this SO 问题中,建议使用UINavigationController。但我找不到有效的实现。

初始 责骂

【问题讨论】:

    标签: react-native statusbar


    【解决方案1】:

    backgroundColor 属性是 android 只能看到 http://facebook.github.io/react-native/releases/0.26/docs/statusbar.html#backgroundcolor

    也许尝试在列表视图上添加一个边距顶部属性与状态栏的高度。

    【讨论】:

      猜你喜欢
      • 2020-01-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多