【发布时间】:2021-02-08 02:56:28
【问题描述】:
目前我有:
-Drawer
--Home (Tab Nav)
---ScreenA
---ScreenB
---ScreenC
--ScreenY
--ScreenZ
当我在 ScreenB 或 ScreenC 上,并转到其他抽屉选项之一说 ScreenY,然后点击“Home”抽屉选项,它会将我带回 ScreenC 或我离开的任何地方。有没有办法让点击主页每次都带我到 ScreenA?希望这是有道理的。
抽屉:
<Drawer.Navigator
drawerStyle={{width: "75%"}}
drawerContent={(props) => <CustomDrawerContent {...props} />}>
<Drawer.Screen name="Home" component={TabNavigator} />
<Drawer.Screen name="Help" component={ScreenY} />
<Drawer.Screen name="Terms" component={ScreenZ} />
</Drawer.Navigator>
标签:
<Tab.Navigator
tabBarOptions={{
activeTintColor: colors.blue,
inactiveTintColor: colors.black,
style: {},
tabStyle: {
backgroundColor: "#e0d5f3",
borderTopWidth: 3,
borderBottomWidth: 3,
borderRightColor: "gray",
},
labelStyle: {
fontWeight: "bold",
},
scrollEnabled: false,
}}
>
<Tab.Screen name="Deals" component={ScreenA} />
<Tab.Screen name="Digital Qs" component={ScreenB} />
<Tab.Screen name="Samples" component={ScreenC} />
</Tab.Navigator>
【问题讨论】:
标签: react-native