我在堆栈导航器中嵌入了一个TabNavigator。我想将标题标题作为当前活动选项卡的标题。我该怎么办?
这是我的堆栈的样子:
const Tabs = createBottomTabNavigator({
Home,
Bookings,
UserCenter,
Wallet,
Help
}, {
tabBarOptions: {
activeTintColor: 'tomato',
inactiveTintColor: 'gray',
},
tabBarPosition: 'bottom',
animationEnabled: false,
swipeEnabled: false
});
const App = createStackNavigator({
Tabs,
HelpQuestion,
Service,
Category,
BookNow,
Favorites,
BookingSummary,
Referral,
Search,
Login,
Signup
}, {
headerMode: 'screen',
navigationOptions:({navigation}) => {
// let title = navigation.state.routes[navigation.state.index])
return {headerTintColor: '#EA0600'}
}
})