如何更改createMaterialBottomTabNavigator标签样式(react-native)?

问题描述 投票:2回答:1

[createMaterialBottomTabNavigator是在react-native上添加bottomTabNavigation的一个非常好的解决方案,但是我还没有找到样式标签的方法,这有可能吗?

react-native react-navigation
1个回答
0
投票

官方文档没有提供任何样式来设置标签样式,但是您可以按照以下方式对其进行样式设置:

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。>

© www.soinside.com 2019 - 2024. All rights reserved.