http://gundumw100.iteye.com/category/156622
http://stars.blog.51cto.com/1966388/1073372(收藏动画)
帧动画,xml文件:animation_left
animation-list:
<?xml version="1.0" encoding="utf-8"?>
<animation-list
xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item android:drawable="@drawable/icon1"
android:duration="100" />
<item android:drawable="@drawable/icon2"
android:duration="100" />
<item android:drawable="@drawable/icon3"
android:duration="100" />
<item android:drawable="@drawable/icon4"
android:duration="100" />
<item android:drawable="@drawable/icon5"
android:duration="100" />
<item android:drawable="@drawable/icon6"
android:duration="100" />
</animation-list>
控件:
ImageView view = (ImageView)findViewById(R.id.view);
view.setBackgroundResource(R.anim.animation_left);
找得一些Animation 补间动画的例子,自己使用。
二、
控件左进,左空,右进,右出
// Animation
private Animation left_in, left_out;
private Animation right_in, right_out;
private void prepareAnim() {
left_in = AnimationUtils.loadAnimation(this, R.anim.left_in);
left_out = AnimationUtils.loadAnimation(this, R.anim.left_out);
right_in = AnimationUtils.loadAnimation(this, R.anim.right_in);
right_out = AnimationUtils.loadAnimation(this, R.anim.right_out);
}
view..startAnimation(left_out);
left_in:
<?xml version="1.0" encoding="utf-8"?>
<set android:shareInterpolator="false"
xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="100%"
android:toXDelta="0"
android:duration="200"/>
</set>
left_out:
<?xml version="1.0" encoding="utf-8"?>
<set android:shareInterpolator="false"
xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="0"
android:toXDelta="-100%"
android:duration="200"/>
</set>
right_in:
<?xml version="1.0" encoding="utf-8"?>
<set android:shareInterpolator="false"
xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="-100%"
android:toXDelta="0"
android:duration="200" />
</set>
right_out:
<?xml version="1.0" encoding="utf-8"?>
<set android:shareInterpolator="false"
xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="0"
android:toXDelta="100%"
android:duration="200" />
</set>