我如何动画在Android中的视图,并让它停留在新的位置/大小?让它、视图、停留在、大小

由网友(北游鱼)分享简介:我现在有一个观点在我的Andr​​oid应用程序,视图是玩帧动画。我想动画视图以增加它的大小为150%。当我申请一个规模的动画给它,规模动画完成后,我想认为留在该活动的生命周期的其余部分是新的大小。不幸的是,现在当比例尺向上动画完成,视图弹回原来的大小。我怎样才能得到它,以保持新的动画tranformation?我用m...

我现在有一个观点在我的Andr​​oid应用程序,视图是玩帧动画。我想动画视图以增加它的大小为150%。当我申请一个规模的动画给它,规模动画完成后,我想认为留在该活动的生命周期的其余部分是新的大小。不幸的是,现在当比例尺向上动画完成,视图弹回原来的大小。我怎样才能得到它,以保持新的动画tranformation?

我用

  myView.startAnimation(AnimationUtils.loadAnimation(mContext,R.anim.scaleUp150));
 

谢谢!

解决方案

  fillAfter =真
fillEnabled =真
 

Android 属性动画分析

I currently have a view in my Android app and the view is playing a frame animation. I want to animate the view to increase its size to 150%. When I apply a scale animation to it, and the scale animation is completed, I want the view to stay at that new size for the rest of the activity's life cycle. Unfortunately right now when the scale up animation is complete, the view snaps back to the original size. How can I get it to keep the new animated tranformation?

I'm using

myView.startAnimation(AnimationUtils.loadAnimation(mContext,R.anim.scaleUp150));

Thanks!

解决方案

fillAfter=true
fillEnabled=true

阅读全文

相关推荐

最新文章