Reputation: 8962
I use React Navigation for routing and navigation in a react native project. I have a bottom tab bar component, which is partially hidden in Android.
TabNavigator
...
{
lazy: true,
tabBarPosition: 'bottom',
animationEnabled: false,
initialRouteName: 'Schedule',
swipeEnabled: false,
tabBarOptions: {
showIcon: true,
showLabel: true,
allowFontScaling: true,
upperCaseLabel: false,
activeTintColor: Colors.white,
inactiveTintColor: Colors.darkGrey,
indicatorStyle: {
// backgroundColor: 'transparent',
},
labelStyle: {
fontSize: 15,
fontWeight: '500',
},
style: {
backgroundColor: Colors.darkBlue,
height: 50,
},
iconStyle: {
height: TAB_ICON_SIZE,
width: TAB_ICON_SIZE,
padding: 0,
margin: 0,
},
},
},
Upvotes: 0
Views: 388
Reputation: 8962
There was margin: 8
for labelStyle
.
Changing labelStyle fixed that:
labelStyle: {
fontSize: 15,
fontWeight: '500',
margin: 2,
},
Upvotes: 0
Reputation: 1316
Add following alignSelf property to iconStyle and make sure that TAB_ICON_SIZE is not greater that 24. Because it's following material guid designs in react-native android.
iconStyle: {
height: TAB_ICON_SIZE,
width: TAB_ICON_SIZE,
padding: 0,
margin: 0,
alignSelf: 'center'
}
Upvotes: 1