结束动画事件的android结束、事件、动画、android

由网友(情少故事多)分享简介:我显示淡出的动画中的图(其是片段内),并每次动画发生,之后它完成的视图再次重绘自身。我发现周围的工作做 view.SetVisibility(View.GONE)。不过,这并不等待动画完成。我想只执行后,动画已经完成了这个setVisibility code。什么是做到这一点的最好方法是什么?I have a fad...

我显示淡出的动画中的图(其是片段内),并每次动画发生,之后它完成的视图再次重绘自身。我发现周围的工作做 view.SetVisibility(View.GONE)。不过,这并不等待动画完成。我想只执行后,动画已经完成了这个setVisibility code。什么是做到这一点的最好方法是什么?

I have a fadeout animation in a view (which is inside a fragment), and everytime the animation happens, after it finishes the view redraws itself again. I found a work around doing view.SetVisibility(View.GONE) . But it doesn't wait for the animation to finish. I would like to execute this setVisibility code only after the animation has finished. What is the best way to do that?

推荐答案

您可以添加动画监听到你的动画对象像

You can add Animation listener to your animation object like

anim.setAnimationListener(new Animation.AnimationListener(){
    @Override
    public void onAnimationStart(Animation arg0) {
    }           
    @Override
    public void onAnimationRepeat(Animation arg0) {
    }           
    @Override
    public void onAnimationEnd(Animation arg0) {
    }
});
阅读全文

相关推荐

最新文章