onAnimationEnd
事件时,安卓动画并没有真正完成,尽管animation.hasEnded
已经设置为true。我想让我的视图在其
ScaleAnimation
结束时更改其背景drawable,它确实会更改,但可以清楚地看到它在完成前几毫秒就被更改了。问题是,新的背景出现(=正在)被缩放一小段时间,直到动画真正完成,这导致它闪烁。有没有办法获得动画的真正结束或者只是防止新的背景在这个短时间内被缩放?
谢谢!
//编辑: 我使用
AnimationListener
来获取以下调用: @Override
public void onAnimationEnd(Animation animation)
{
View view = (MyView) ((ExtendedScaleAnimation) animation).getView();
view.clearAnimation();
view.requestLayout();
view.refreshBackground(); // <-- this is where the background gets changed
}