您好,欢迎来到化拓教育网。
搜索
您的当前位置:首页动画--->FrameAnimation(帧动画)初步认识

动画--->FrameAnimation(帧动画)初步认识

来源:化拓教育网

目录

无标题.png

说明

动画由一系列图片组成,一帧一帧播放
onshot属性(true:只播放一次 false:播放多次)

演示

图片引用了:
image.png

代码

ss.xml (Drawable) 动画布局文件
<?xml version="1.0" encoding="utf-8"?>
<animation-list 
    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();

Copyright © 2019- huatuo9.cn 版权所有 赣ICP备2023008801号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务