开发者

Merge two animations in Android

开发者 https://www.devze.com 2023-03-28 17:20 出处:网络
I\'m trying to combine two animations programmatically. In that simplified example: Animation translate = new TranslateAnimation(0, -100, 0, 0);

I'm trying to combine two animations programmatically. In that simplified example:

 Animation translate = new TranslateAnimation(0, -100, 0, 0);
     translate.setDuration(1000);
 Animation zoom = new ScaleAnimation(0, 1, 0, 1);
     zoom.setDuration(1000);

I want the view make both animations at the same time. How can I do it?

The background of that question is because I have a more complex animation in a xml file and I want to combine that animation with a translation without modifying the开发者_JS百科 original xml.

Thanks


Merge two Animation using AnimationSet


You can go for AnimationSet and add both animations into that AnimationSet and start that AnimationSet

0

精彩评论

暂无评论...
验证码 换一张
取 消