Android的动画监听器 [英] Android Animation Listener

查看:182
本文介绍了Android的动画监听器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在触摸图像鉴于我在动画开始褪色:

On touch of an image view I start a fade in animation:

    myImageView.setOnTouchListener(new View.OnTouchListener() {
    public boolean onTouch(View v, MotionEvent event) {
    v.startAnimation(fadeInAnimation);

我知道我需要一个动画监听器来找出当动画已完成,但我怎么重视这一点,以便我可以认为动画刚刚完成...我想设置视图的可见性动画后完成。

I know I need an animation listener to find out when the animation is complete but how do I attach this so that I can get the view that the animation has just completed on... I want to set the visibility of the view after the animation is done.

感谢

推荐答案

我觉得你需要这个。

fadeInAnimation.setAnimationListener(new Animation.AnimationListener() {
    @Override
    public void onAnimationStart(Animation animation) {

    }

    @Override
    public void onAnimationEnd(Animation animation) {

    }

    @Override
    public void onAnimationRepeat(Animation animation) {

    }
});

这篇关于Android的动画监听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆