从TabNavigator导航到另一个屏幕

时间:2018-09-13 21:17:29

标签: react-native react-redux react-router react-navigation

要登录,注册,忘记密码,我使用StackNavigator在屏幕之间导航,然后导航到屏幕上带有差异内容的hava 3选项卡,我想从选项卡导航到另一个屏幕,我该怎么做?
AppRouteConfig

const AppRouteConfig = createStackNavigator({
    SignIn: { screen: SignIn },
    SignUp: { screen: SignUp},
    LoggedIn: { screen: LoggedIn },
    ForgotPassword: { screen: ForgotPassword },
});
export default AppRouteConfig;

登录后,我通过this.props.navigation.navigate('LoggedIn')

调用屏幕 LoggedIn
export default class LoggedIn extends Component {
  static navigationOptions = () => ({
    header: null,
    gesturesEnabled: false,
  });

  render() {
    return (
      <LoggedInTabNavigator/>
    );
  }
}

然后使用3个选项卡调用ExploreContainer
LoggedInTabNavigator

export const ExploreTab = StackNavigator({
    ExploreContainer: {screen: MapContainer},
    Profile: {screen: ProfileContainer},
    SavedContainer: {screen: SavedContainer},
    SalaCategories:{ screen: SalaCategories} 
});

const LoggedInTabNavigator = TabNavigator({
    Explore: {screen: MapContainer},
    Profile: {screen: ProfileContainer},
    Save: {screen: SavedContainer},// i need to navigate to this screen
}, {
    tabBarOptions: {
        labelStyle: {
            fontWeight: '600',
            marginBottom: 5,
        },
        activeTintColor: colors.pink
    },
    tabBarComponent: TabBarBottom,
    tabBarPosition: 'bottom',
});

export default LoggedInTabNavigator;

那我该如何解决这个问题?

0 个答案:

没有答案