使用 React Native 和 React-navigation 状态栏中的颜色

Jam*_*een 5 javascript node.js reactjs react-native react-navigation

react-navigation在 React Native 中使用,并且我已经更改了标题颜色

const MyScreenNavigator = StackNavigator({
  ...
}, {
  navigationOptions: {
    headerStyle: {
      backgroundColor: 'blue',
    },
    headerTintColor: 'white'
  }
});
Run Code Online (Sandbox Code Playgroud)

它确实改变了标题和状态栏的背景颜色,但状态栏中的字体颜色仍然是黑色。

如何自定义状态栏的字体颜色?

zvo*_*ona 0

API 和文档仍然经常更改,但为了设计StackNavigator的标头,请使用headerTitleStyle: { color: 'white' }. (https://reactnavigation.org/docs/navigators/stack#headerTitleStyle