How do I hide the shadow under react-navigation headers?

后端 未结 14 970
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-03 21:30

How do I hide the shadow under react-navigation headers?
They look like this.

相关标签:
14条回答
  • 2021-02-03 22:10

    in react-navigation version 5.x.x:

          <Tab.Navigator
            tabBarOptions={{
              activeTintColor: colors.darkGray,
              labelStyle: { fontSize: 12 },
              style: { backgroundColor: colors.white, borderTopWidth: 0, elevation: 0, shadowOpacity: 0, },
            }}
          >
    
    0 讨论(0)
  • 2021-02-03 22:10

    Try passing cardStyle: { shadowColor: 'transparent' }

    export const AppNavigator = StackNavigator(
    {
      Login: { screen: LoginScreen },
      Main: { screen: MainScreen },
      Profile: { screen: ProfileScreen },
    },
    cardStyle: { shadowColor: 'transparent' }
    

    As per this question React Navigation Stack Navigator default shadow styling

    0 讨论(0)
提交回复
热议问题