无论我设置多长时间,这个动画都不会动画,它只是立即消失 这是java代码和xml
Java 代码:
Animation shrink =AnimationUtils.loadAnimation(Page.this, R.anim.shrink);
deleteMe.startAnimation(shrink);
XML 文件:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true"
android:shareInterpolator="true"
android:interpolator="@android:anim/linear_interpolator"
android:duration="10000">
<scale
android:duration="10000"
android:fillAfter="true"
android:fromXScale="1.0"
android:toXScale="0" >
</scale>
<alpha
android:duration="10000"
android:fromAlpha="1.0"
android:toAlpha="0">
</alpha>
</set>
最佳答案
使用您想要的值指定 set 标记的 android:interpolator 属性。 该插值器只是以稳定的速率将对象从起点移动到终点(或旋转)。
例如::
android:interpolator="@android:anim/linear_interpolator"
关于java动画android持续时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14051095/