I use react-native-tab-view. So how to set background color only to selected tab?
This is what I have...
<TabView
navigationState={this.state}
renderScene={SceneMap({
first: FirstRoute,
second: SecondRoute,
third: ThirdRoute,
fourth: FourthRoute,
})}
onIndexChange={index => this.setState({ index })}
initialLayout={{ width: Dimensions.get('window').width, height: Dimensions.get('window').height }}
useNativeDriver = {true}
renderTabBar={(props) =>
<TabBar
{...props}
indicatorStyle={{ backgroundColor: 'white' }}
style={{backgroundColor: "black", height: 40}}
renderIcon={this.renderIcon}
indicatorStyle={{backgroundColor: "#555555"}}
/>
}
/>
Thank you!