美文网首页
缩放动画的使用

缩放动画的使用

作者: 没风的地方 | 来源:发表于2020-11-16 11:12 被阅读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);
}
}

相关文章

网友评论

      本文标题:缩放动画的使用

      本文链接:https://www.haomeiwen.com/subject/pamabktx.html