简体   繁体   English

React Native-使用滚动动画底部标签栏

[英]React Native - Animate bottom tab bar with scroll

In my react native project, I want bottom tabBar to be shown on screen, as you scroll upwards with your finger, say 200 offset y, the tabBar hides with animation, and when you scroll down, again, say 200 offset y, it shows the tabBar again. 在我的react native项目中,我希望在屏幕上显示底部的tabBar,当您用手指向上滚动(例如,偏移200)时,tabBar随动画一起隐藏,而当您向下滚动时,再次显示(例如,偏移200)y,它将显示tabBar再次。

I am using createBottomTabNavigator. 我正在使用createBottomTabNavigator。 I am able to show/hide bottom bar without animation. 我可以显示/隐藏没有动画的底部栏。

I have tried 我努力了

https://github.com/react-navigation/react-navigation/issues/888#issuecomment-299600368 https://github.com/react-navigation/react-navigation/issues/888#issuecomment-299600368

https://github.com/react-navigation/react-navigation/issues/958 https://github.com/react-navigation/react-navigation/issues/958

Below is my code 下面是我的代码

navigationOptions: ({ navigation }) => {
        const params = navigation.state.params;
        return {
          tabBarVisible: params && params.tabBarVisible,
          animationEnabled: true,
        }
      },

How can I animate the bottom bar as user scrolls the list? 当用户滚动列表时,如何为底部的栏设置动画?

Thanks in advance. 提前致谢。

If you want a bottom navigation with animation, you can use the createMaterialTopTabNavigator and simply set the tabBarPosition. 如果要使用动画进行底部导航,则可以使用createMaterialTopTabNavigator并只需设置tabBarPosition。

For detail information about createMaterialTopTabNavigator 有关createMaterialTopTabNavigator的详细信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM