Swiping between tabs using createMaterialBottomTabNavigator for android

…衆ロ難τιáo~ 提交于 2019-12-14 02:12:13

问题


I have used React Navigation's createMaterialBottomTabNavigator to create a bottom tab navigator in my app. I want the screens to "slide" in from the left or right when the tab is changed, and swiping on the screen to be able to change tabs. I've looked into the documentation https://reactnavigation.org/docs/en/material-bottom-tab-navigator.html, and I can't find any configuration options that would make this happen. Why is this?


回答1:


Solution

You can use createMaterialTopTabNavigator instead of createMaterialBottomTabNavigator and set the tabBarPosition option to bottom. Official

Why?

swipeEnabled is not supported anymore in BottomTabnavigator of React Navigation > 2.0.

It is worth noting additionally that createBottomTabNavigator is different from the bottom tab navigator that is available through TabNavigator in that it does not support animationEnabled or swipeEnabled properties.

Check Release note.



来源:https://stackoverflow.com/questions/53197395/swiping-between-tabs-using-creatematerialbottomtabnavigator-for-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!