change background color of createMaterialTopTabNavigator screens

408 Views Asked by At

I need to change all of the tabNavigators screen background color

 <Tab.Navigator
  tabBarOptions={{
    style: {
      display: 'none',
    },
  }}>
  <Tab.Screen name="screen" component={screen} />
  <Tab.Screen name="screen2" component={screen2} />
  <Tab.Screen name="screen3" component={screen3} />
</Tab.Navigator>

How can i change the background color of every screen?

1

There are 1 best solutions below

0
On

Found the answer!

 <Tab.Navigator
  sceneContainerStyle={{
    backgroundColor: theme['primaryColor'],
  }}
 >

for createMaterialTopTabNavigation you have to use sceneContainerStyle and apply it to the wrapper and it will add it to each screen :)