Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change navigation header color in react native?

How do I change the color of the navigation header in a React Native app?

I tried initialising background color but it didn't work.

Below is my code snippet for navigationOptions:

static navigationOptions = ({ navigation }) => ({
    header: props => <Header 
        navigation={navigation}
        title={'Dashboard'}
        toggleDrawer
    />
})

Also, is it possible to set status bar color?

like image 279
Abhishek D Avatar asked Mar 06 '23 07:03

Abhishek D


1 Answers

You can change it with headerStyle:

navigationOptions = {
  headerStyle: {
    backgroundColor: 'red',
  },
);

For status bar, see https://facebook.github.io/react-native/docs/statusbar.html

like image 96
Roy Wang Avatar answered Mar 24 '23 17:03

Roy Wang