我制作了一帧动画,但是图片之间的转换效果看起来很糟糕。如何应用交叉淡入淡出效果?
当使用TransitionDrawable
时,我得到了正确的结果,但它在执行一次后就停止了。
有人有解决方法吗?
public void startAnimation() {
if (logoAnimation != null) {
if (logoAnimation.isRunning()) {
logoAnimation.stop();
}
logoAnimation.start();
}
}
private int setLogoAnimation(int animationID, int targetID) {
imageView = (ImageView) window.findViewById(targetID);
imageView.setImageResource(animationID);
logoAnimation = (AnimationDrawable) imageView.getDrawable();
if (imageView != null && logoAnimation != null) {
return 1;
} else {
return 0;
}
}
然后我只需通过object.startAnimation()运行它,它可以工作,但动画效果很丑,我需要它更加流畅。