1

I tried establishing a default background color for all my headers, but it is not working.

I am using defaultNavigationOptions and it is not working.

const RootStack = createStackNavigator(
  {
    Home: HomeScreen,
    Details: DetailsScreen
  },
  {
    initialRouteName: "Home",
    defaultNavigationOptions: {
      headerStyle: {
        backgroundColor: "#6B52AE"
      },
      headerTintColor: "#fff",
      headerTitleStyle: {
        fontWeight: "bold"
      }
    }
  }
);

I am expecting a purple background, but when I reload the ios simulator, I get a white header instead.

csb00
  • 1,091
  • 2
  • 18
  • 36

1 Answers1

0

You can define the tabBarOptions:

tabBarOptions: {
        activeTintColor: "#480ee6", //Active label
        labelStyle: {
            fontSize: 12
        },
        style: { backgroundColor: "#6B52AE" } //TabBar
    }
fl3a
  • 108
  • 5