Home > Article > Web Front-end > How to solve the problem that internal tabs cannot be switched normally when multiple tabs are nested in react-navigation
The problem should be that when the user slides or switches, it is impossible to determine which tabs should slide and switch and display the switching animation.
swipeEnabled - Whether to allow sliding between tabs
animationEnabled - Whether to animate when changing tabs
In root tabsSet in navigation settings:
const MyApp = TabNavigator({ Home: { screen: MyHomeScreen, }, ChildrenTabs: { screen: ChildrenTabsScreen, },}, { //这里加两句设置,将切换动画和能否滑动设为false swipeEnabled:false, animationEnabled: false, //将这两个设置false后就不会产生父子tabs之间的冲突了 tabBarOptions: { activeTintColor: '#e91e63', },});
After setting, you should be able to switch normally.
The above is the detailed content of How to solve the problem that internal tabs cannot be switched normally when multiple tabs are nested in react-navigation. For more information, please follow other related articles on the PHP Chinese website!