[createMaterialBottomTabNavigator是在react-native
上添加bottomTabNavigation的一个非常好的解决方案,但是我还没有找到样式标签的方法,这有可能吗?
官方文档没有提供任何样式来设置标签样式,但是您可以按照以下方式对其进行样式设置:
navigationOptions: {
tabBarLabel: <Text style={{fontFamily : "pacifico", textAlign : "center"}}>Meals</Text>,
tabBarIcon: (tabInfo) => {
return (<MaterialCommunityIcons name="food-fork-drink" size={23}
color={tabInfo.tintColor}></MaterialCommunityIcons>)
},
tabBarColor: "#222f3e"
}
通过将样式包装在tabBarLabel
组件中直接将样式应用于Text
。>