2012-04-17 95 views
0

我需要在xml中定义Animation.RELATIVE_TO_SELF而不是在代码中?我正在尝试添加一个旋转动画以跟随我的翻译动画(在xml中定义)。但是,下面的代码不起作用,我可以在xml中找到参数pivotXType。请帮助...如何添加旋转动画来翻译动画?

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); 

回答