简体   繁体   中英

Android: Move View after animation?

I'm trying to basically have a button move down to the bottom of the screen with an animation after it is clicked.

I have the animation working perfectly, but the button doesn't stay at the bottom of the screen after the animation finishes. I've tried using offsetTopAndBottom() , but it only stays down there for one frame, and is redrawn at the top. How can I get the button to stay?

Did you try to call setFillAfter(true) on your animation instance?

Regards!

Yes, setFillAfter(true) works.

But the strange thing is that corresponding android:fillAfter XML attribute does not provide same effect. Be aware, guys.

Your button is not clickable because you are using View animation instead of the Property Animation. View animation only change where your View is drawn instead of really moving it to that location. Property animation does the trick.

I answered your question on another thread. You can check it out here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM