动画--->FrameAnimation(帧动画)初步认识
作者:
pgydbh | 来源:发表于
2018-04-27 14:51 被阅读145次
目录

无标题.png
说明
动画由一系列图片组成,一帧一帧播放
onshot属性(true:只播放一次 false:播放多次)
演示

image.png
代码
ss.xml (Drawable) 动画布局文件
<?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/gpf"
android:duration="100" />
<item
android:drawable="@drawable/gpo"
android:duration="100" />
<item
android:drawable="@drawable/gpn"
android:duration="100" />
</animation-list>
layout
<ImageView
android:layout_width="match_parent"
android:id="@+id/img"
android:layout_height="match_parent"
android:src="@drawable/ss"/>
java
AnimationDrawable animationDrawable = (AnimationDrawable) imgHead.getDrawable();
animationDrawable.start();
本文标题:动画--->FrameAnimation(帧动画)初步认识
本文链接:https://www.haomeiwen.com/subject/hbwblftx.html
网友评论