Change createMaterialTopTabNavigator active style

Viewed 66

I am using react native and currently have this css code for the navigator function code

<Tabs.Navigator
                screenOptions={{
                    tabBarScrollEnabled: true,
                    tabBarShowLabel: false,
                    tabBarActiveTintColor: 'green',
                    tabBarStyle: {
                        backgroundColor: theme.backgroundColor,
                        position: 'absolute',
                        bottom: 0,
                        left: 0,
                        right: 0,
                        margin: 50,
                        maxHeight: 50,
                        borderRadius: 10,
                        justifyContent: 'center',
                        ...style.shadow
                    }
                }}
            >

How do I style the active blue bar selector. I would ideally just want to change the color. What is the best way to go about this. I have tried using tabBarActiveTintColor with no luck. What I want styled

2 Answers

Use the tabBarIndicatorStyle: { backgroundColor: 'green' }, to change bar color in version 6 :)

please do this

tabBarOptions={{ tabBarActiveTintColor:'blue' }}

It helps you lots.

Related