React Native Tabnavigation动画

问题描述 投票:0回答:1

我已经使用以下代码实现了启用动画的选项卡导航器(为了便于阅读,省略了图标代码)。

正如您所看到的导航,当我单击每个选项卡(例如,第一个选项卡,然后第五个选项卡)时,中间的图标都改变了颜色。有没有办法在启用动画的同时“跳转”到选项卡?

const FirstStack = createTabNavigator(
  {
    Home: { screen: Home },
    List: { screen: List },
    Check: { screen: Check },
    Open: { screen: Open },
    Settings: { screen: Settings }
  },
  {

    tabBarOptions: {
      activeTintColor: "#00af9d",
      inactiveTintColor: "grey",
      style: {
        backgroundColor: "white",
        paddingTop: 10
      },
      showLabel: false
    },
    animationEnabled: true
  }
)

react-native react-navigation
1个回答
0
投票

正如文档中针对反应导航所述,要在底部选项卡中启用动画,您需要材料设计选项卡,您可以了解它们以及如何安装它们here

© www.soinside.com 2019 - 2024. All rights reserved.