Android:Translation and Rotation Animation simultaneously

半城伤御伤魂 提交于 2019-11-30 13:39:58

I have done it Using ANIMATIONSET we can do this.

AnimationSet snowMov1 = new AnimationSet(true);
        RotateAnimation rotate1 = new RotateAnimation(0,360, Animation.RELATIVE_TO_SELF,0.5f , Animation.RELATIVE_TO_SELF,0.5f );
        rotate1.setStartOffset(50);
        rotate1.setDuration(9500);
        snowMov1.addAnimation(rotate1);
        TranslateAnimation trans1 =  new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0.1f, Animation.RELATIVE_TO_PARENT, 0.3f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.9f);
        trans1.setDuration(12000);
        snowMov1.addAnimation(trans1);

In this way we can made set for multiple animations.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!