您的位置:首页 > 其它

安卓动画之Frame动画

2016-01-24 17:02 239 查看
帧动画是按顺序播放一组预先定义好的图片,不同于View动画,系统提供了另外一个类AnimationDrawable来使用帧动画

<?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/share_eject1" android:duration="500"/>
<item android:drawable="@drawable/share_eject2" android:duration="500"/>
<item android:drawable="@drawable/share_eject3" android:duration="500"/>
</animation-list>


frame = (Button) findViewById(R.id.frame);
frame.setBackgroundResource(R.drawable.frame_animation);
AnimationDrawable drawable = (AnimationDrawable) frame.getBackground();
drawable.start();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: