对于导航文件的一部分,我有以下createDrawerNavigator
:
const DrawerNavigation = createDrawerNavigator({
Home: {
screen: HomePage,
navigationOptions: {
title: "Home"
}
},
Loads: {
screen: LoadTabs,
navigationOptions: {
title: "Loads"
}
},
LoadsDetails: {
screen: LoadsDetails,
navigationOptions: {
title: "Load Details"
}
},...
然后我有实际的createStackNavigator
设置引用了上面的内容:
const StackNavigation = createStackNavigator({
DrawerNavigation: { screen: DrawerNavigation }
}, {
headerMode: 'float',
navigationOptions: ({ navigation, screenProps }) => ({
headerStyle: { backgroundColor: '#4C3E54' },
headerTintColor: 'white',
headerLeft: drawerButton(navigation),
headerRight: cartButton(navigation, screenProps)
})
});
我的问题是,尽管一切正常,但标题从未出现在任何屏幕上。我是否以某种方式在createDrawerNavigator中设置不正确?如果是这样,更合适的方式是什么?
谢谢!