- Home /
How to make a button that opens and closes a tab?
Like in the two images above, I want to be able to click the top of the phone to play an animation of the phone sliding up, and then be able to click that same part of the phone to play an animation of it sliding back down. I don't know how to do this, but what I've tried so far is to just have an invisible button on the top of the phone that when clicked, bring the phone up, but I don't know how to bring it back down. Help would be greatly appreciated.
Answer by lvskiprof · Dec 16, 2021 at 06:48 PM
You could do the same thing, but in this case the invisible button is disabled until the phone has completely slid up. You then enable it and when clicked it will trigger the animation to bring it down. I would disable the button that brings it up right after it gets clicked and do the same for the button to bring it down. This second button could be either just the top part of the phone or cover the whole phone, whichever way you want it to work.
Your answer
Follow this Question
Related Questions
Play an animation when UI button is pressed 0 Answers
How to disable button animation fade? 1 Answer
Material Design Menu 1 Answer
Unity 4.6 UI Button Click Animation? 4 Answers