zoukankan      html  css  js  c++  java
  • Android开发之(1)AnimationListener

    1,就像Button控件有监听器一样,动画效果也有监听器,只需要实现AnimationListener就可以实现对动画效果的监听,只需要实现AnimationListener就可以实现对动画效果的监听,其中需要重载三个函数,就是下面的这几个函数:


    private class MyListenr implements AnimationListener{
    @Override

    public void onAnimationEnd(Animation arg0) {
    // TODO Auto-generated
    method stub
    }
    @Override
    public void onAnimationRepeat(Animation
    arg0) {
    // TODO Auto-generated method stub
    }
    @Override
    public
    void onAnimationStart(Animation arg0) {
    // TODO Auto-generated method stub

    }

    }

    其中第一个函数的意思是在动画执行完之后需要开发者做什么,第二个函数的意思是在动画重复执行的过程中应该做什么,第三个函数的意思是当动画开始执行时有什么动作发生。

    2,实例

    AlphaAnimation animation = new AlphaAnimation(0.0f, 1.0f);//设置电话透明度

    第一个参数fromAlpha表示动画起始时的透明度, 第二个参数toAlpha表示动画结束时的透明度。 
    animation.setDuration(3000);//设置动画时间

    view.startAnimation(start_anima);
      start_anima.setAnimationListener(new AnimationListener() {

      重载上面的三个函数;

    }

    3,【Android动画片】之Tween动画 (渐变、缩放、位移、旋转)

    http://www.myexception.cn/android/1014731.html

  • 相关阅读:
    mysql安装停在make[3]: Leaving directory `/mysql5.xx/mysqltest' 解决方法
    搞了个burst
    PKU2074
    PKU2029
    ACM/ICPC要求的知识点(转)
    PKU3264线段树解法
    PKU2036
    PKU1151线段树解法
    今天递了辞呈
    hamachi
  • 原文地址:https://www.cnblogs.com/manmanlu/p/4045017.html
Copyright © 2011-2022 走看看