我在堆栈下有两个标签:
const AppStack = createStackNavigator(
{
Home: {
screen: createBottomTabNavigator(
{
Home: {
screen: TodosScreen,
navigationOptions: ({ navigation }) => ({
title: navigation.state.routeName
})
},
Profile: {
screen: ProfileScreen,
navigationOptions: ({ navigation }) => ({
title: navigation.state.routeName
})
}
},
{
initialRouteName: 'Home',
}
),
navigationOptions: ({ navigation }) => {
console.log('navigation = ', navigation.state);
return {
title: navigation.state.routeName
};
}
}
}
);
我正在考虑根据底部标签导航器路线名称更改stacknavigators标题?这怎么可能实现?