React native 反应本机选项卡视图:如何在更改选项卡时更改文本颜色

React native 反应本机选项卡视图:如何在更改选项卡时更改文本颜色,react-native,React Native,我正在使用react-native社区/react-native选项卡视图 是否有任何方法可以在更改选项卡时更改选项卡文本颜色。现在它只是使文本颜色变浅,但希望将其更改为其他颜色?在这种情况下,请尝试将回调传递到选项卡视图中的renderLabel属性,如下所示: \u renderLabel=(场景)=>{ const myStyle={/*在此处定义了您的样式..*/} //从现场抓起标签,我不太确定 //关于场景的结构,但您可以使用console.log查看它 常量标签=scene.la

我正在使用react-native社区/react-native选项卡视图
是否有任何方法可以在更改选项卡时更改选项卡文本颜色。现在它只是使文本颜色变浅,但希望将其更改为其他颜色?

在这种情况下,请尝试将回调传递到
选项卡视图中的
renderLabel
属性,如下所示:

\u renderLabel=(场景)=>{
const myStyle={/*在此处定义了您的样式..*/}
//从现场抓起标签,我不太确定
//关于场景的结构,但您可以使用console.log查看它
常量标签=scene.label
返回(
{label}
);
}
_renderHeader=()=>{
返回

}
我真的很抱歉我想问你这个(编辑过的问题)…有没有办法在更改选项卡时更改文本颜色
To change the text color on your TabBar, it should look like this: 
<TabBar
     {...props}
     indicatorStyle={{ backgroundColor: '#eeaf3b' }}
     style={{ backgroundColor: '#282828', height: 55 }}
     indicatorStyle={{ backgroundColor: '#eeaf3b', height: 5 }}
     renderLabel={this.renderLabel} />
renderLabel = ({ route, focused, color }) => {
return (
  <View>
    <Text
      style={[focused ? styles.activeTabTextColor : styles.tabTextColor]}
    >
      {route.title}
    </Text>
  </View>
)
}
const styles = StyleSheet.create({
  activeTabTextColor: {
    color: '#eeaf3b'
  },
  tabTextColor: {
    color: '#ccc'
  }
})