标签:
rlRoot = (RelativeLayout) findViewById(R.id.rl_root); //旋转动画 RotateAnimation animRotate = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); animRotate.setDuration(1000); //动画时间 animRotate.setFillAfter(true); //保持动画结束状态 //缩放动画 ScaleAnimation animScale = new ScaleAnimation(0,1,0,1, Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f); animScale.setDuration(1000); animScale.setFillAfter(true); //渐变动画 AlphaAnimation animAlpha = new AlphaAnimation(0,1); animAlpha.setDuration(2000); animAlpha.setFillAfter(true); //动画集合 AnimationSet set = new AnimationSet(true); set.addAnimation(animAlpha); set.addAnimation(animRotate); set.addAnimation(animScale); //启动动画 rlRoot.startAnimation(set); //设置动画监听 set.setAnimationListener(new Animation.AnimationListener() { //需要实现的方法 }
标签:
原文地址:http://www.cnblogs.com/cxsy/p/5596940.html