0
我正在使用react-native-community/react-native-tab-view 是否有任何方法可以更改選項卡上的選項卡文本顏色。現在它只是減輕文字顏色,但想改變它不同的顏色?反應原生選項卡視圖:如何更改選項卡更改上的文本顏色
我正在使用react-native-community/react-native-tab-view 是否有任何方法可以更改選項卡上的選項卡文本顏色。現在它只是減輕文字顏色,但想改變它不同的顏色?反應原生選項卡視圖:如何更改選項卡更改上的文本顏色
在這種情況下,嘗試通過回調到renderLabel
財產在你TabView
像這樣:
_renderLabel = (scene) => {
const myStyle = { /* Defined your style here.. */ }
// grab the label from the scene. I'm not really sure
// about the structure of scene, but you can see it using console.log
const label = scene.label
return (
<Text style={myStyle}>{label}</Text>
);
}
_renderHeader =() => {
return <TabBar renderLabel={this._renderLabel} />
}
真是對不起我的意思是問你這個(編輯問題).. ..有沒有辦法改變標籤變化的文字顏色 –