react-navigation.github.io icon indicating copy to clipboard operation
react-navigation.github.io copied to clipboard

Indicator not aligned with text in createMaterialTopTabNavigator

Open hasn-ab opened this issue 4 years ago • 0 comments

I am trying to implement the top tab with scrollable tabs which are dynamic in number.

Following is my code:

<View style={{flex: 1}}>
        {categories.length > 0 && (
          <Tab.Navigator
            lazy
            tabBarOptions={{
              labelStyle: {
                fontSize: 13,
                fontFamily: gothamMedium,
                textTransform: 'none',
                alignSelf: 'center',
                textAlign: 'center',
              },
              indicatorStyle: {
                backgroundColor: colors.AQUAMARINE,
                height: 4,
              },
              activeTintColor: colors.GREYISH_BROWN,
              inactiveTintColor: colors.WARM_GREY,
              scrollEnabled: true,
            }}>
            {categories.map(category => (
              <Tab.Screen
                options={{
                  title: category.title,
                }}
                name={category.title}
                component={() => <TabList tabData={category} />}
              />
            ))}
          </Tab.Navigator>
        )}  </View>

Which works fine for the first tab: Untitledd

And here is how second tab looks like:

Untitled

And it gets worse scrolled to 3rd and beyond

hasn-ab avatar May 28 '21 12:05 hasn-ab