【发布时间】:2020-01-16 15:03:07
【问题描述】:
我一直在尝试放大视图,然后通过类似于动画的缩小返回到原始大小。
我能够做的是在一组中放大和缩小,并在按钮单击时在图像视图上对其进行动画处理,但它第一次突然降低了图像大小,然后在以后的单击中动画效果很好。我将不胜感激任何帮助来完成流畅的动画
我的代码
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true"
>
<scale
android:duration="1000"
android:fromXScale="1"
android:fromYScale="1"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale=".5"
android:toYScale=".5" >
</scale>
<scale
android:duration="1000"
android:fromXScale=".5"
android:fromYScale=".5"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1"
android:toYScale="1" >
</scale>
</set>
final Animation ani_in = AnimationUtils.loadAnimation(getApplicationContext(),R.anim.zoomin_out);
imageView.startAnimation(ani_in);
【问题讨论】: