How to remove fullwidth tab in createMaterialTopTabNavigator

532 views Asked by At

I'm having a hard time how to remove the fullwidth tab in createMaterialTopTabNavigator. I'm using this library https://reactnavigation.org/docs/material-top-tab-navigator/

Current output: enter image description here

Expected output: enter image description here

I appreciate your help on this!

1

There are 1 answers

2
Kartikey On

Try something like this

<Tab.Navigator
    tabBarOptions={{
      style: { alignItems: 'flex-start' },
      tabStyle: { alignItems: 'center', width: 100 },
      indicatorStyle: { width: 100 },
    }}>
    <Tab.Screen name="Home" component={HomeScreen} />
    <Tab.Screen name="Settings" component={SettingsScreen} />
</Tab.Navigator>

See here