I am using react native switch component and I want to change the color of switch when I turn it OFF.
I can add onTintColor
property to change the color when it is turned on.
Is there any way to change the color while turning it OFF?
From the HOME Menu select "System Settings" > "System" > "Change Display Colours". Select from one of the following options: Default. Invert Colours.
Switch can be disabled by setting the disabled property to true.
onTintColor has been deprecated try the following.
<Switch
trackColor={{true: 'red', false: 'grey'}}
onValueChange={this.toggleSwitch}
value={true}/>
this works
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With