本文介绍了Android的缩放动画的弹跳插的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我做了大规模动画动画XML
如下。动画插补器无法正常工作。我想有反弹插,但不工作。
< XML版本=1.0编码=UTF-8&GT?;
<设置的xmlns:机器人=http://schemas.android.com/apk/res/android>
<规模
机器人:时间=900
机器人:fromXScale =1
机器人:fromYScale =0.5
机器人:插=@机器人:动画/ bounce_interpolator
机器人:pivotX =50%
机器人:pivotY =0%
机器人:toXScale =1.0
机器人:toYScale =1.0/>
< /集>
编辑:其实我的整个XML是
< XML版本=1.0编码=UTF-8&GT?;
<设置的xmlns:机器人=http://schemas.android.com/apk/res/android>
<规模
机器人:时间=600
机器人:fromXScale =1
机器人:fromYScale =0.5
机器人:插=@机器人:动画/ bounce_interpolator
机器人:pivotX =50%
机器人:pivotY =0%
机器人:toXScale =1.0
机器人:toYScale =1.0/>
<阿尔法
机器人:时间=@安卓整数/ config_longAnimTime
机器人:fromAlpha =0.0
机器人:插=@机器人:动画/ decelerate_interpolator
机器人:toAlpha =1.0/>
< /集>
解决方案
终于得到了解决。这对我的作品,可能是帮助他人。关键是把机器人:插标记在动画集
< XML版本=1.0编码=UTF-8&GT?;
<设置的xmlns:机器人=http://schemas.android.com/apk/res/android
机器人:插=@机器人:动画/ bounce_interpolator>
<规模
机器人:时间=600
机器人:fromXScale =1
机器人:fromYScale =0.5
机器人:pivotX =50%
机器人:pivotY =0%
机器人:toXScale =1.0
机器人:toYScale =1.0/>
<阿尔法
机器人:时间=600
机器人:fromAlpha =0.0
机器人:toAlpha =1.0/>
< /集>
I am doing a scale animation with anim xml
as follows. The animation interpolator isn't working. I am trying to have bounce interpolator but isn't working.
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<scale
android:duration="900"
android:fromXScale="1"
android:fromYScale="0.5"
android:interpolator="@android:anim/bounce_interpolator"
android:pivotX="50%"
android:pivotY="0%"
android:toXScale="1.0"
android:toYScale="1.0" />
</set>
EDIT:Actually my whole xml is
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<scale
android:duration="600"
android:fromXScale="1"
android:fromYScale="0.5"
android:interpolator="@android:anim/bounce_interpolator"
android:pivotX="50%"
android:pivotY="0%"
android:toXScale="1.0"
android:toYScale="1.0" />
<alpha
android:duration="@android:integer/config_longAnimTime"
android:fromAlpha="0.0"
android:interpolator="@android:anim/decelerate_interpolator"
android:toAlpha="1.0" />
</set>
解决方案
Finally got the solution. It works for me and could be helpful to others. The key was to put the android:interpolator tag in the animation set.
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/bounce_interpolator" >
<scale
android:duration="600"
android:fromXScale="1"
android:fromYScale="0.5"
android:pivotX="50%"
android:pivotY="0%"
android:toXScale="1.0"
android:toYScale="1.0" />
<alpha
android:duration="600"
android:fromAlpha="0.0"
android:toAlpha="1.0" />
</set>
这篇关于Android的缩放动画的弹跳插的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!