如何在活动的createMaterialTopTabNavigator中更改背景颜色?

时间:2020-04-01 08:11:04

标签: react-native react-navigation react-native-navigation

我需要在活动标签上更改背景颜色。我在文档中发现了如何更改文本的颜色,而不是背景的颜色。

我的代码:

const Tab = createMaterialTopTabNavigator();
    return (
        <View>
            <Tab.Navigator
                tabBarOptions={{
                    labelStyle: { fontSize: 12 },
                    activeTintColor : "#FFFFFF",
                    inactiveTintColor : "#2B5E4A",
                    pressOpacity  : ".8",
                    activeTabStyle : {backgroundColor : 'red'},
                    tabStyle: { borderColor : '#2B5E4A', borderWidth : 2, backgroundColor : '#2B5E4A', borderRadius : 4, overflow : 'hidden' },
                    indicatorStyle : { backgroundColor : 'transparent' },
                    style : {paddingHorizontal : 20, paddingVertical : 16},
                }}
            >
                <Tab.Screen
                    name="Home"
                    component={Home}
                />
                <Tab.Screen name="Settings" component={Settings} />
            </Tab.Navigator>
        </View>
    );

0 个答案:

没有答案
相关问题