0

我想将动画应用于networkImageView中的默认图像并将其缩放到中心,然后在图像加载后再次将其缩放回fit_XY。请建议我如何实现它。谢谢

4

1 回答 1

0

在 res 文件夹中创建 anim 文件夹。将下面的xml文件放在anim文件夹中。

 <?xml version="1.0" encoding="utf-8"?>
    <set xmlns:android="http://schemas.android.com/apk/res/android">
   <scale 
    android:fromXScale="1"
    android:toXScale="0"
    android:fromYScale="1"
    android:toYScale="0"
    android:duration="200"
    android:pivotX="50%"
    android:pivotY="50%"/>

    </set>

然后在java代码中。写在下面的行。

Animation animation = AnimationUtils.loadAnimation(this, R.anim.test_animations);


            sampleImageView.startAnimation(animation);
于 2014-12-11T11:27:37.570 回答