繁体   English   中英

如何添加旋转动画以翻译动画?

[英]How to add Rotate animation to translate animation?

我需要在xml中而不是在代码中定义Animation.RELATIVE_TO_SELF? 我正在尝试添加旋转动画以及我的平移动画(在xml中定义),但是下面的代码不起作用,我可以在xml中找到参数ivotXType。 请帮忙...

anim = new RotateAnimation(0, 10,
                    Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF,
                                    0);
                anim.setInterpolator(interpolator);
                anim.setDuration(mDuration);
                anim.setFillEnabled(true);
                anim.setFillAfter(true);
                ((AnimationSet)view_1_anim_c).addAnimation(anim);
                apa1.startAnimation(view_1_anim_c);

签出AnimationSet或在动画XML中使用<set>标签。

暂无
暂无

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

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