1.在drawable下建立play_animation.xml
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android">
<!--帧动画-->
<item
android:drawable="@mipmap/play1"
android:duration="300" />
<item
android:drawable="@mipmap/play2"
android:duration="300" />
<item
android:drawable="@mipmap/play3"
android:duration="300" />
</animation-list>
2.在点击播放时设置控件资源
play.setImageResource(R.drawable.play_animation);
AnimationDrawable animationDrawable = (AnimationDrawable) ((ImageView) play).getDrawable();
animationDrawable.start();//播放动画
3.暂停动画
animationDrawable.stop();
博客介绍了动画相关操作的实现步骤,包括在drawable下建立play_animation.xml,在点击播放时设置控件资源,以及暂停动画的操作,这些操作与信息技术中的动画设置相关。
3284

被折叠的 条评论
为什么被折叠?



