如果在使用React导航时使用TabNavigator,如何设置标题和按钮导航栏?

时间:2018-08-29 04:08:47

标签: javascript reactjs react-native react-navigation

我在我的React Native应用程序中同时使用了堆栈导航和标签导航,但是在标签导航中,我无法在导航栏顶部设置标题或按钮。 喜欢

  const AppStackNavigator = createStackNavigator({
  Login: {
  screen: SignIn,
  },
  SignUp: {
screen: SignUp,
},
 profile: {
 screen: profile,
},
NewsFeed: {
screen: TabContainer,
}

})

const TabBars = createBottomTabNavigator({
profile: {
screen: profile,
navigationOptions: {
  tabBarLabel: "Profile",
  headerLeft:null,
  tabBarIcon: ({ tintColor }) => (<Icon name="user" size={30} 
color="#900" />)
}
},
NewsFeed: {
screen: NewsFeed,
navigationOptions: {
  tabBarLabel: "Timeline",
  tabBarIcon: ({ tintColor }) => (<Icon name="th-list" size={30} 
color="#900" />)
}
},
Settings:{
screen:Settings,
navigationOptions: {
  tabBarLabel: "Settings",
  tabBarIcon: ({ tintColor }) => (<Icon name="gear" size={30} 
color="#900" />)
}
 }
});

我想要在createTabNavigator上设置标题,例如set tabBarLable,并且在createStackNavigation上使用navigationOptions时也不会显示标题。

0 个答案:

没有答案