React-native-tab-view: How to change default blue tab bar background and default yellow active tab underline?

Created on 25 Nov 2018  路  7Comments  路  Source: satya164/react-native-tab-view


Current behaviour

How to change default blue tab bar background and default yellow active tab underline?

Code sample

Following sample from readme

Most helpful comment

To change the default tab bar you need to custumize a tabBar and pass it to the prop renderTabbar.

An example to explain more is as follow i prefer to do it in seperate function :

renderTabBar(props) {
return ( style={{backgroundColor: '#FFFFFF', elevation: 0, borderColor: '#000000', borderBottomWidth: 1, height:50}}
labelStyle={{color: 'black', fontSize: 18, fontWeight: 'bold'}}
{...props}
indicatorStyle={{backgroundColor: '#e65970', height: 2.5}}
/>
);
}

Then pass it to the TabView:

TabView renderTabBar={this.renderTabBar}

And about the Indicator Style in the renderTabBar you can find a prop called indicatorStyle do what you want to that indicator.

Good Luck :) .

All 7 comments

To change the default tab bar you need to custumize a tabBar and pass it to the prop renderTabbar.

An example to explain more is as follow i prefer to do it in seperate function :

renderTabBar(props) {
return ( style={{backgroundColor: '#FFFFFF', elevation: 0, borderColor: '#000000', borderBottomWidth: 1, height:50}}
labelStyle={{color: 'black', fontSize: 18, fontWeight: 'bold'}}
{...props}
indicatorStyle={{backgroundColor: '#e65970', height: 2.5}}
/>
);
}

Then pass it to the TabView:

TabView renderTabBar={this.renderTabBar}

And about the Indicator Style in the renderTabBar you can find a prop called indicatorStyle do what you want to that indicator.

Good Luck :) .

Thanks. Found solution already from the example in repo.

how to set title tabs to normal without uppercase ?

how to set title tabs to normal without uppercase ?

textTransform: 'capitalize'

it's funny because textTransform: 'none' is the single one that doesn't work :D

how to change active tab fontcolor to black and inactive tab fontcolor to grey?

Thanks. Found solution already from the example in repo.

can you send me the solution

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KingAmo picture KingAmo  路  3Comments

moerabaya picture moerabaya  路  4Comments

t3chnoboy picture t3chnoboy  路  3Comments

nastarfan picture nastarfan  路  3Comments

AndriiUhryn picture AndriiUhryn  路  3Comments