这是我的navigation.js:
<p>
因此,该应用启动了,您会看到if
屏幕:
export const BottomTabs = createBottomTabNavigator({
'Specials': {
screen:SpecialsScreen
},
'Menus': {
screen:MenusScreen
},
});
export const Drawer = DrawerNavigator({
Home: { screen: Home, navigationOptions: {drawerLabel:() => null} },
Explore: { screen: BottomTabs },
'Support & Contact': { screen: ContactScreen },
Settings: { screen: Settings, navigationOptions: {drawerLabel:() => null} },
TOU: { screen: TOU, navigationOptions: {drawerLabel:() => 'Terms of Use'} },
Privacy: { screen: Privacy, navigationOptions: {drawerLabel:() => 'Privacy Policy'} },
Disclaimer: { screen: Disclaimer },
});
从那里单击“我同意”使用条款,并发送到Home
屏幕:
App.js
render(){
return(<Provider store={store}><Drawer /></Provider>)
}
在Explore
中,我点击了汉堡包图标以切换我的抽屉,然后转到HomeScreen.js
<TouchableOpacity onPress={() => {
this.props.navigation.navigate('Specials');
}}>
,从中有一个后退按钮,我想带我回到上一屏幕:
Specials
但是,这将我带到Support & Contact
,而不是我想象的ContactScreen.js
<TouchableOpacity onPress={() => {
this.props.navigation.goBack();
}}>
或Home
。我想念什么?
答案 0 :(得分:0)
必须添加堆栈导航器
const AppStack = createStackNavigator({ App: SpecialsScreen, MenusScreen });
const HomeStack = createStackNavigator({ Home });