我在DrawerNavigator上重叠StackNavigator。这是我的代码
const AppNavigator = StackNavigator({
Home: {
screen: WelcomeContainer,
navigationOptions: ({navigation}) => ({
headerLeft:
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems:'center'}}>
<Icon name="menu" color='#5c72b0' size={35} style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems:'center',
paddingLeft:10,
paddingRight:80 }} onPress={ () => navigation.navigate('DrawerOpen') } />
<ChangeLanguage style={{ margin: 30 , padding: 30}} />
</View>,
headerRight:
<HeaderUserInformation />,
})
},
Settings: {
screen: SettingsContainer,
navigationOptions: ({navigation}) => ({
title: navigation.state.params.title
})
},
About: {
screen: About,
navigationOptions: ({navigation}) => ({
title: navigation.state.params.title
})
}
})
const AppDrawer = DrawerNavigator({
Home: {
screen:StackNavigator({
Home: {
screen: WelcomeContainer,
navigationOptions: {
}
}
})
},
Settings: {
screen: StackNavigator({
Category: {
screen: SettingsContainer,
navigationOptions: {
title: "Settings"
}
}
})
}
})
抽屉工作正常,但标题有问题。在将DrawNavigator嵌入DrawerNavigator之前,情况并非如此。问题是我通过添加按钮来定制标题,我不再在标题上看到它们了。当我导航到新的屏幕时,我不再看到标题上的后退按钮了。你知道问题是什么吗?