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

How to solve the problem that internal tabs cannot be switched normally when multiple tabs are nested in react-navigation

一个新手
一个新手Original
2017-10-12 10:18:161819browse

Cause

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.

Solution

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn