【发布时间】:2014-09-09 04:39:00
【问题描述】:
当我将此动画添加到相对布局中的图像视图时,图像会跳转到更大的比例,然后才能平滑地增长和缩小(然后跳转回其原始大小)。
当我在下面显示的文件中注释掉第二个“缩放”动画时,不会发生这种意外的跳跃。为什么?我想不通。
主活动:
ImageView image = (ImageView)findViewById(R.id.imageView1);
Animation animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.myanimation);
image.startAnimation(animation);
myanimation.xml:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<scale
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="2000"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="3.0"
android:toYScale="3.0" >
</scale>
<scale
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="2000"
android:fromXScale="3.0"
android:fromYScale="3.0"
android:pivotX="50%"
android:pivotY="50%"
android:startOffset="2000"
android:toXScale="1.0"
android:toYScale="1.0" >
</scale>
</set>
【问题讨论】:
标签: android android-animation scale