*:- 我有底部标签 =>(主页、列表、数据)。*:- 我有一个抽屉导航。*:- 我也想在抽屉导航中添加(主页、列表、数据)。*:- 然后我想从抽屉导航触发选项卡更改。*:-假设如果我从抽屉中单击列表或数据项,它应该调用事件并更改底部选项卡
我的代码
const tabNavigator = createBottomTabNavigator({
HomeStack,
UserStack,
LinksStack,
SettingsStack
});
const AppStack = createStackNavigator(
{ Main: tabNavigator },
{
headerMode: "none"
}
);
const DrawerNav = createDrawerNavigator(
{
Home: AppStack
},
{
contentComponent: props => (
<SafeAreaView style={styles.container}>
<View
style={{
height: 100,
alignItems: "center",
justifyContent: "center",
background: "#5cb7e6"
}}
></View>
<ScrollView>
<DrawerItems {...props} />
</ScrollView>
</SafeAreaView>
)
}
);
const AuthStack = createStackNavigator (
{ SignIn: Login },
{
headerMode: "none"
}
);
export default createAppContainer(
createSwitchNavigator(
{
AuthLoading: AuthLoadingScreen,
App: DrawerNav,
Auth: AuthStack
},
{
initialRouteName: "AuthLoading",
defaultNavigationOptions: {
headerStyle: {
backgroundColor: "#0082c6"
},
headerTintColor: "#fff",
headerLayoutPreset: "center",
headerTitleStyle: {
fontWeight: "bold"
}
}
}
)
);