In React-Native with React-Navigation I have a Tabnavigator like so:
const testScreenNavigator = TabNavigator({
Tab1: { screen: Tab1Screen },
Tab2: { screen: Tab2Screen },
Tab3: { screen: Tab3Screen },
});
testScreenNavigator.navigationOptions = {
title: 'MY TITLE',
header: {
titleStyle:{
},
style:{
// how to set the options?
},
}
}
Now I want to do 2 things:
Regards
To set background color for Header use navigationOptions
and to set background color for Tab use tabBarOptions
. See below code
const testScreenNavigator = TabNavigator ({
Tab1: { screen: RecentChatsScreen },
Tab2: { screen: AllContactsScreen },
Tab3: { screen: AllContactsScreen}
}, {
tabBarOptions : {
style: {
backgroundColor: '#42a5f5',
}
}
});
testScreenNavigator.navigationOptions = {
title: 'MY TITLE',
header: {
style: {
backgroundColor: '#42a5f5',
}
},
};
below is output