Change the color of a rectangle on click to create a custom button

Rutu W shared this question 5 years ago
Answered

I am trying to create a custom button with a simple rectangle. I have a gray rectangle, when someone clicks it I want it to turn orange, then when someone clicks it again I want it to turn gray back.


I tried on toggle and change style to orange but it does not turn back to gray when I click it again.

Comments (3)

photo
1

That should work. Can you see an example to jim.support at justinmind.com please?

photo
1

thats odd its working now, I must have done something wrong, thank you :)


Only problem now is that if there is text on the button I cannot click on the button. For that it looks like I have to give the interaction to both the button and the text.

photo
1

Or you could have changed the style of the text until it looks like the orange rectangle and use just that instead a text and a rectangle.