反应标签的导航标题

时间:2018-09-30 11:36:59

标签: react-native react-navigation

我在堆栈导航器中嵌入了一个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'}
  }
})

0 个答案:

没有答案