[android]代码库
cycle.xml :
<?xml version="1.0" encoding="utf-8"?>
<cycleInterpolator
xmlns:android="http://schemas.android.com/apk/res/android"
android:cycles="2"/>
myanim.xml :
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@anim/cycle"
>
<translate
android:fromXDelta="0"
android:toXDelta="-10"
android:fromYDelta="0"
android:toYDelta="-10"
android:duration="300"/>
<translate
android:fromXDelta="0"
android:toXDelta="10"
android:fromYDelta="0"
android:toYDelta="-10"
android:startOffset="300"
android:duration="300"/>
<translate
android:fromXDelta="0"
android:toXDelta="-10"
android:fromYDelta="0"
android:toYDelta="10"
android:startOffset="600"
android:duration="300"/>
<translate
android:fromXDelta="0"
android:toXDelta="10"
android:fromYDelta="0"
android:toYDelta="10"
android:startOffset="900"
android:duration="300"/>
</set>
在activity里面使用这个动画效果了:
Animation anim = AnimationUtils.loadAnimation(AnimActivity.this, R.anim.myanim);
myButton.startAnimation(anim);
by: 发表于:2017-10-24 09:18:59 顶(0) | 踩(0) 回复
??
回复评论