/** * 动画集合:将多个动画放入集合后使用,动画累积 * @return */ private AnimationSet animationFactory() { //缩放动画 ScaleAnimation sa = new ScaleAnimation(0.3f, 1.0f, 0.3f, 1.0f, Animation.RELATIVE_TO_SELF, 0,Animation.RELATIVE_TO_SELF, 0.5f); sa.setDuration(300); //透明度动画 AlphaAnimation aa = new AlphaAnimation(0.5f, 1.0f); aa.setDuration(300); // 动画集合 AnimationSet animationSet = new AnimationSet(false); animationSet.addAnimation(sa); animationSet.addAnimation(aa); return animationSet; }
时间: 2024-11-09 04:44:20