AdelRedaa97 / react-native-select-dropdown

react-native-select-dropdown is a highly customized dropdown | select | picker | menu for react native that works for andriod and iOS platforms.
MIT License
314 stars 134 forks source link

defaultButtonText color #135

Closed ildibicaku closed 4 months ago

ildibicaku commented 1 year ago

Is there any way i can change the color of defaultButtonText ? Lets say I want defaultButtonText color gray and when I selected one of the values the value to appear black

aqifkhan commented 1 year ago

I searched, but didn't find anything for changing defaultButtonText. But you can change it from your side using useState. I will share an example

const [defaultColorGender, setDefaultColorGender] = useState('gray') // Here you can use your default color

<SelectDropdown dropdownStyle={{ borderRadius: 15 }} data={gender} renderDropdownIcon={DropDownIcon} buttonStyle={{ width: '90%', backgroundColor: '#FFFFFF' }} onSelect={(selectedItem, index) => { setDefaultColorGender('#000000') // As you select any option from dropdown then you can change color of your button text }} selectedRowStyle={{ backgroundColor: '#F4F7FF' }} selectedRowTextStyle={{ color: COLORS.Primary,fontFamily: FONTS.Medium }} rowStyle={{ backgroundColor: '#FFFFFF' }} rowTextStyle={{ textAlign: 'left', paddingLeft: 5, fontSize: 14 ,fontFamily: FONTS.Medium }} defaultButtonText='Add your gender' buttonTextStyle={{ color:defaultColorGender }} // In start You will get your default color here />

ildibicaku commented 1 year ago

Thank you @aqifkhan

AdelRedaa97 commented 4 months ago

A lot of changes were made in v4.0, take a look here https://github.com/AdelRedaa97/react-native-select-dropdown?tab=readme-ov-file#-major-changes

Feel free to open the issue again if it still exists