在android上工作了几天,我正试着通过按一个按钮来旋转箭头。使用RotateAnimation和:
setFillAfter(true);箭头保持在预期的最后位置。但是当我再次按下箭头按钮时,yes开始从初始位置旋转,但也有上次调用动画时的“上一个”箭头,它最终与“新”箭头重叠。所以我想我需要以某种方式重置/清除setFillAfter,但我找不到方法。
我的代码是这样的:
//Animation start
float Xaxis=0.835366f;
float Yaxis=0.676692f;
RotateAnimation rotateAnimation1 = new RotateAnimation(0, 180,
Animation.RELATIVE_TO_SELF, Xaxis,Animation.RELATIVE_TO_SELF, Yaxis);
rotateAnimation1.setInterpolator(new LinearInterpolator());
rotateAnimation1.setDuration(2500);
rotateAnimation1.setRepeatCount(0);
image.startAnimation(rotateAnimation1);
rotateAnimation1.setAnimationListener(this);
@Override
public void onAnimationEnd(Animation animation) {
animation.setFillAfter(true);
}任何想法都是有用的..我已经尝试了无效,clearAnimation到图像,设置填充后为假,重置动画,但仍然相同。
发布于 2013-03-08 20:17:45
它是固定的,模拟器配置了共享GPU,并且运行良好。速度快,没有任何先前动画的残留物。
https://stackoverflow.com/questions/15229135
复制相似问题