Android ListView Animation 布局动画

时间:2014-07-16 19:28:17   收藏:0   阅读:354
    AnimationSet set = new AnimationSet(false);  
    Animation animation = new AlphaAnimation(0,1);   //AlphaAnimation 控制渐变透明的动画效果  
    animation.setDuration(500);     //动画时间毫秒数  
    set.addAnimation(animation);    //加入动画集合  
      
    animation = new TranslateAnimation(1, 13, 10, 50);  //ScaleAnimation 控制尺寸伸缩的动画效果  
    animation.setDuration(300);  
    set.addAnimation(animation);  
      
    animation = new RotateAnimation(30,10);    //TranslateAnimation  控制画面平移的动画效果  
    animation.setDuration(300);  
    set.addAnimation(animation);  
      
    animation = new ScaleAnimation(5,0,2,0);    //RotateAnimation  控制画面角度变化的动画效果  
    animation.setDuration(300);  
    set.addAnimation(animation);  
      
    LayoutAnimationController controller = new LayoutAnimationController(set, 1);  
      
      
    GridView gridView = (GridView) this.findViewById(R.id.gridview);  
    gridView .setLayoutAnimation(controller);  //GridView 设置动画效果  
      
    ListView listview= (ListView)this.findViewById(R.id.listview);  
    listview.setLayoutAnimation(controller);   //ListView 设置动画效果  

 

Android ListView Animation 布局动画,布布扣,bubuko.com

原文:http://www.cnblogs.com/HelloGuang/p/3841281.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!