使用选项卡导航的本机导航

时间:2019-04-16 07:21:25

标签: react-native navigation-drawer react-navigation

尝试配置包含标签导航的导航。

这是我在MainApp中所做的:

const AppTabNavigator = createBottomTabNavigator({
Home: {
  screen: Home
},
Settings:{
  screen: Settings
}
});


const AuthStackNavigator = createStackNavigator({   
      Welcome: Welcome,
      SignIn: SignIn,
SignUp: SignUp });


const AppStackNavigator = createStackNavigator({ 
        AppTabNavigator: {
          screen: AppTabNavigator,
          navigationOptions: ({navigation}) => ({
            title: '',
            headerLeft: (
    <TouchableOpacity onPress={()=>navigation.toggleDrawer()}>
      <View style={{ paddingHorizontal: 10 }}>
          <Ionicons name="md-menu" size={24} />
      </View>
    </TouchableOpacity>
            )
          })
        }

});

const AppDrawerNavigator = createDrawerNavigator({
Home: AppStackNavigator
});


const App = createAppContainer(createSwitchNavigator(
{
      AuthLoading: AuthInterceptorService,
      Auth: AuthStackNavigator,
      App: AppDrawerNavigator,

    },
    {
      initialRouteName: 'AuthLoading',
    }
  ));

挑战: 如何将导航和navigationoptions添加到抽屉中的Home项目中,并且标签navigator已经注入Home项目中?

0 个答案:

没有答案