i want to make my button update its background color from white to blue and when i click again i want to make the background white again. how can is it possible to do this from the stylesheet? if not how can i do this
button:
<TouchableOpacity style = {styles.circular}></TouchableOpacity>
style:
circular:{
width:15,
height:15,
borderColor:'#55bcf6',
borderRadius:5,
borderWidth:3,
backgroundColor:'white'
},
3
Answers
Try adding an onClick attribute, a color state and a dynamic style, something like this:
using [] in style
there you can you change the background Color and apply it with the default