简体   繁体   中英

Android slide out fragment animation

I am currently making a card game. Basically, I am using fragments to do some animations with the cards. So far I have been able to get the card to flip over from the back of the card to the face of the card. However, once the face of the card is show and the user has seen it. I would like them to be able to press a button and have the face of the card slide off of the deck. I can't figure out how to slide the card off of the deck and have the back of another card shown beneath it.

thanks for your help

Assuming you are using ViewPager to show your stack of Cards, you can use the PageTransformer to slide the card out. It's easier if the action is sliding the card rather than a button - But you can get it done your way as well.

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