简体   繁体   English

android动画活动切换

[英]android animate activity switching

I need to start activity B from activity A. Activity B must be started with an ScaleAnimation from certain coordinates. 我需要从活动A开始活动B。活动B必须以ScaleAnimation从某些坐标开始。 Usually, switching activities with animation is done by 通常,通过动画切换活动是通过以下方式完成的:

overridePendingTransition(R.anim.anim1, R.anim.anim2);

but the position from where my activity "rise" is known only at runtime. 但是仅在运行时才知道我的活动“上升”的位置。 Is there a way to accomplish this? 有没有办法做到这一点?

You have to define your animation then programmatically instead of using the XML. 您必须先定义动画,然后以编程方式而不是使用XML。 You can check more here: http://developer.android.com/reference/android/view/animation/ScaleAnimation.html 您可以在此处查看更多信息: http : //developer.android.com/reference/android/view/animation/ScaleAnimation.html

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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