码迷,mamicode.com
首页 > 其他好文 > 详细

图片动画播放

时间:2015-02-03 16:40:32      阅读:244      评论:0      收藏:0      [点我收藏+]

标签:

图片动画播放:

import android.view.animation.Animation;
import android.view.animation.AnimationSet;
//import android.view.animation.RotateAnimation; 
import android.view.animation.ScaleAnimation;

 

 AnimationSet animationSet = new AnimationSet(true); 
     if(mAnimationSet!=null && mAnimationSet != animationSet){
      ScaleAnimation scaleAnimation = new ScaleAnimation(2,0.5f,2,0.5f,
        Animation.RELATIVE_TO_PARENT,0.5f,   //使用动画播放图片       
        Animation.RELATIVE_TO_PARENT,0.5f); 
                scaleAnimation.setDuration(1000);                     
                                   mAnimationSet.addAnimation(scaleAnimation); 
                                   mAnimationSet.setFillAfter(false); //让其保持动画结束时的状态。                        v.startAnimation(mAnimationSet);                    }                    ScaleAnimation scaleAnimation = new ScaleAnimation(1,2f,1,2f,                            Animation.RELATIVE_TO_SELF,0.5f,                             Animation.RELATIVE_TO_SELF,0.5f);                    scaleAnimation.setDuration(3000);                    animationSet.addAnimation(scaleAnimation);                    animationSet.setFillAfter(true);                     v.startAnimation(animationSet);                    mAnimationSet = animationSet;
       
     }
      ScaleAnimation scaleAnimation = new ScaleAnimation(1,2f,1,2f,   
                         Animation.RELATIVE_TO_SELF,0.5f,  
                            Animation.RELATIVE_TO_SELF,0.5f);  
                   scaleAnimation.setDuration(3000);   
                  animationSet.addAnimation(scaleAnimation); 
                    animationSet.setFillAfter(true);                  
                     v.startAnimation(animationSet);   
               
                    mAnimationSet = animationSet; 

图片动画播放

标签:

原文地址:http://www.cnblogs.com/realhope/p/4270145.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!