我使用 react-native-tab-view。那么如何仅将背景颜色设置为选定的选项卡?
这就是我所拥有的...
<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"}}
/>
}
/>
谢谢!