使用createMaterialBottomTabNavigator for Android在标签之间滑动

时间:2018-11-07 20:34:10

标签: android react-native react-navigation

我已经使用React Navigation的createMaterialBottomTabNavigator在我的应用程序中创建一个底部标签导航器。我希望屏幕在选项卡更改时从左侧或右侧“向内滑动”,并在屏幕上滑动以能够更改选项卡。我已经研究了文档https://reactnavigation.org/docs/en/material-bottom-tab-navigator.html,但找不到任何可以实现此目标的配置选项。为什么会这样?

1 个答案:

答案 0 :(得分:3)

解决方案

您可以使用createMaterialTopTabNavigator代替createMaterialBottomTabNavigator,并将tabBarPosition选项设置为底部。 Official

为什么?

React Navigation> 2.0的BottomTabnavigator不再支持

swipeEnabled

  

另外值得注意的是,createBottomTabNavigator与可通过TabNavigator使用的底部标签导航器不同,因为它不支持animationEnabled或swipeEnabled属性。

选中Release note

相关问题