Reputation: 365
I created a custom Navbar and it is looking great. The only problem it is displaying over the screens, where I want it to display like a normal navbar. So, is there a way to to add margin to the navbar instead of adding for each screen ?
Here is my implementation:
<Tab.Navigator
initialRouteName="Home"
animationEnabled={false}
tabBar={(props) => <CustomBottomNavbar {...props} avatar={avatar} />}
tabBarOptions={{
activeTintColor: Colors.orange,
inactiveTintColor: Colors.gray,
showLabel: false,
showIcon: true,
tabStyle: {
marginTop: hp(1.5),
},
keyboardHidesTabBar: true,
}}>
{tabScreens}
</Tab.Navigator>
and Everything I put in the tabStyle
isn't working
and it looks like this:
Upvotes: 0
Views: 158
Reputation: 2359
You can use style
inside tabBarOptions
<Tab.Navigator
initialRouteName="Home"
animationEnabled={false}
tabBar={(props) => <CustomBottomNavbar {...props} avatar={avatar} />}
tabBarOptions={{
activeTintColor: Colors.orange,
inactiveTintColor: Colors.gray,
showLabel: false,
showIcon: true,
style: {
marginTop: 10,
},
keyboardHidesTabBar: true,
}}>
{tabScreens}
</Tab.Navigator>
Upvotes: 1