导航到屏幕,使之与反应导航混淆

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

我有一个下面的导航器:

BottomNavigator
      Home           -> (Profile Screen)         
      StackNavigator
            Menu     -> (Profile Screen) 

我的问题是-

我应该在哪里将个人资料屏幕从首页和有意义的菜单屏幕。

对我的英语表示感谢和抱歉。

react-native react-navigation
1个回答
0
投票

如下所示,用新的stackNavigator包装BottomNavigatorProfileScreen。并且不要忘记提供一些选择。

例如,

StackNavigator
 ㄴBottomNavigator
   ㄴ ...
 ㄴProfileScreen
const RootNavigator = createStackNavigator({
  Bottom: BottomNavigator,
  Profile: ProfileScreen 
}, {
  defaultNavigationOptions: {
    mode: 'modal',
    header: none,
  }
})

它使您可以从任何地方调用Profile

navigation.navigate('Profile')
© www.soinside.com 2019 - 2024. All rights reserved.