Change the background color of the navigation title

Strive to understand how to change the background color of the navigation title bar. I am using react navigation and Expo to build my application.

backgroundColor

doesn't seem to do anything. Any idea how to do this?

My code is below:

static navigationOptions = () => ({
    title: 'My App',
    headerTintColor: Colors.DarkBlue,
    backgroundColor: 'red',
    headerLeft:
      <HeaderBarItem to='InfoScreen' title='App info' />,
    headerRight:
      <HeaderBarItem to='FeedbackScreen' title='Feedback' />
  });

      

+3


source to share


1 answer


This should work:



static navigationOptions = () => ({
    title: 'My App',
    headerTintColor: Colors.DarkBlue,
    headerStyle: {
      backgroundColor: 'red'
    },
    headerLeft:
      <HeaderBarItem to='InfoScreen' title='App info' />,
    headerRight:
      <HeaderBarItem to='FeedbackScreen' title='Feedback' />
  });
      

Run code


+7


source







All Articles