如何在createBottomTabNavigator中添加createMaterialTopTabNavigator

时间:2019-11-26 10:03:45

标签: react-native react-navigation

我想做这样的事情,顶部标签应该放在底部主页标签中。

1 个答案:

答案 0 :(得分:1)

您的意思是当您按下bottomNav中的“主页”按钮时,会出现topNav吗?

然后您可以执行以下操作(登录);

const switchNavigator = createSwitchNavigator({
  loginFlow: createStackNavigator({
    Signup: SignupScreen,
    Signin: SigninScreen
  }),
  mainFlow: createBottomTabNavigator({
    bottomFlow: createStackNavigator({
      Home: HomeScreen,
      Settings: SettingsScreen
    }),
    topFlow: createMaterialTopTabNavigator({
      topScreen1: TopScreen1,
      topScreen2: TopScreen2,
      topScreen3: TopScreen3
    })
  });

  export default createAppContainer(switchNavigator);

导入所有内容时,我认为应该这样做。