缩放动画的使用

public void createAnim() {
if (enlargeAnimation == null) {
enlargeAnimation = new ScaleAnimation(1, 1.05f, 1, 1.05f, Animation.RELATIVE_TO_SELF, 0.5f, 1, 0.5f);
enlargeAnimation.setDuration(1000);
enlargeAnimation.setRepeatMode(Animation.REVERSE);
enlargeAnimation.setRepeatCount(Animation.INFINITE);
}
if (shrinkAnimation == null) {
shrinkAnimation = new ScaleAnimation(1, 0.9f, 1, 0.9f, Animation.RELATIVE_TO_SELF, 0.5f, 1, 0.5f);
shrinkAnimation.setDuration(500);
shrinkAnimation.setRepeatMode(Animation.REVERSE);
shrinkAnimation.setRepeatCount(Animation.INFINITE);
}
}

你可能感兴趣的:(缩放动画的使用)