缩放动画的使用

2020-11-16  本文已影响0人  没风的地方

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);
}
}

上一篇 下一篇

猜你喜欢

热点阅读