我在我的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时也不会显示标题。