1

I am using React Navigation 5 for implementing tab bar. Then I set horizontal and bottom margin for tab bar by using code bellow:

    <NavigationContainer>
      <Tab.Navigator
        tabBarOptions={{
          style: {
            backgroundColor: Colors.GRAY,
            marginBottom: 6,
            marginHorizontal: 6,
          },
        }}
      >
      </Tab.Navigator>
    </NavigationContainer>

However, I am seeing white color on sides of the tab bar (which comes from root view, as tab bar has margins). How can I change the background color of the root view to the color I want?

Dusan
  • 163
  • 13
  • Check this answer on changing default color https://stackoverflow.com/a/63160187/1435722 – Guruparan Giritharan Aug 04 '20 at 09:26
  • That will not do, as it will set background of NavigationContainer. However, my NavigationContainer has margins, and because of that I need to manipulate with background of the RootView. – Dusan Aug 04 '20 at 09:30
  • @Dusan Did you find any solution ? Got the same problem for other reason... – Doubidou Jan 12 '22 at 10:53

0 Answers0