我想知道如何使用九个 olad androids 框架动画创建脉冲效果。
为了更好地理解,假设您有一个 ImageView 并希望有一个“脉冲”效果,例如 将图像缩小一点,然后恢复到原始大小,缩放将居中。
为了向后兼容,我使用了九个 olad android。
欢迎任何其他选择。
谢谢。
最佳答案
R.anim.pulse
:
<scale xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1000"
android:fromXScale="1"
android:fromYScale="1"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="1"
android:repeatMode="reverse"
android:toXScale="0.5"
android:toYScale="0.5" />
ImageView imageView = (ImageView) findViewById(R.id.image);
Animation pulse = AnimationUtils.loadAnimation(this, R.anim.pulse);
imageView.startAnimation(pulse);
关于android - 如何使用九个旧的 androids 动画创建 ImageView 脉冲效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14216798/