Change Label color of Drop down


#1

I am new to React native and working on a project on that, I am using react-native material-dropdown for using drop down component .i want to change the label color of drop-down but i am unable to do it because i didn’t find label color property to change .could someone help me with this as the label is taking default color as black for the label text.

tintColor:’#000
textColor:’#000
I tried giving these two styles also but it doesn’t work for me. Do anyone have a solution for that? Thanks in advance


#2

Hi @nisha_nishu - have you tried looking at the documentation for react-native-material-dropdown? From a quick glance it looks like the itemColor, selectedItemColor, and disabledItemColor fields are what you need.


#3

hii @esamelson
I have gone through the documentation clearly
i want to change the color of the label of drop down but not the colors of the items of drop down

For Example
<Dropdown
label=‘Height(Cm)’
placeholderTextColor = “#FFF
onChangeText={(height) => this.setState({height})}
value={this.state.height}
ref=“height”
data={heightData} />

In the above example, i want to change the color of the label "Height " but not the drop down items


#4

Hi @nisha_nishu - maybe ask on the react-native-material-dropdown repo? We don’t use this library at Expo so we’re unlikely to know the answer :disappointed:


#5

Did you try to use baseColor as described in their documentation? I hope that is what you are looking for!


#6

Tq @rauldeheer
I got the solution by adding these two lines to my code

style = {{color: ‘white’}} //for changed text color
baseColor="#FFF" //for initial text color


#7

Thanks for ur time @esamelson i got the solution


closed #8

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.