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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With