work hard work smart

专注于Java后端开发。 不断总结,举一反三。
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Android 动画

Posted on 2014-02-25 20:52  work hard work smart  阅读(333)  评论(0)    收藏  举报

 

1.闪烁动画 AlphaAnimation

    privatevoid startFlickerAnimation(ImageView img) {  
              final Animation animation = new AlphaAnimation(1f, 0)f;          
              animation.setDuration(500);  
              animation.setInterpolator(new LinearInterpolator()); // do not alter animation rate  
              animation.setRepeatCount(Animation.INFINITE); // Repeat animation infinitely  
              animation.setRepeatMode(Animation.REVERSE); //  
              img.setAnimation(animation);
              animation.start();
        }