使用bottomtabnavigator时从stacknavigator进行的屏幕导航不起作用

问题描述 投票:0回答:1

我是本机的新手,我在一个屏幕到另一个屏幕之间导航时遇到问题。我正在像这样使用stacknavigator:

const RootStack = createStackNavigator(
    {
        Splash: { screen: SplashScreen},
        Mobile:{screen:MobileAuthentication} ,
        Code:{screen:CodeAuthentication} ,
        Home: { screen: HomeScreen },
        ProfileScreen: { screen: ProfileScreen },
        ProfileDetails: { screen: ProfileDetails },
    },
    { initialRouteName: 'Splash'}
);
const AppContainer = createAppContainer(RootStack);

在主屏幕中,我正在使用buttomtabnavigator

const bottomTabNavigator = createBottomTabNavigator(
  {
    A: {
      screen: ProfileScreen,
      navigationOptions: {
...
      }
    },
    B: {
      screen: FilterScreen,
      navigationOptions: {
...
      }
    },
  },
  {
    initialRouteName: 'FilterScreen',
    tabBarOptions: {
      activeTintColor: '#3F51B5'
    }
  }
);
const AppContainer = createAppContainer(bottomTabNavigator);

问题是,当我想通过ProfileScreenProfileDetails导航到onpress时,它不起作用

       <ProfileBtn
          onPress={() => {
            console.log('item Clicked'),
            this.props.navigation.navigate('ProfileDetails')
          } }
         />
react-navigation
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.