Android 图片的帧动画
16lz
2021-01-23
Android之中有 Obj 动画 即 UI动画 和 Image的Fragment动画
①Image动画
将一系列图片照顺序 排列 组成一个序列展示
XML文件存放路径: res/anim/filename.xml
:
通过使用rescoure id进行访问
-
<?xml version="1.0" encoding="utf-8"?>
<animation-listxmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<itemandroid:drawable="@drawable/rocket_thrust1"android:duration="200"/>
<itemandroid:drawable="@drawable/rocket_thrust2"android:duration="200"/>
<itemandroid:drawable="@drawable/rocket_thrust3"android:duration="200"/>
</animation-list>
使用动画:
ImageView rocketImage =(ImageView) findViewById(R.id.rocket_image)
rocketImage.setBackgroundResource
(R.drawable.rocket_thrust);
-
rocketAnimation =(AnimationDrawable) rocketImage.
getBackground()
;
rocketAnimation.start()
;
更多相关文章
- Android:动画效果translate、scale、alpha、rotate详解
- Android listview 制作表格样式+由下往上动画弹出效果实现
- Android转场动画windowAnimation和ActivityAnimation的区别
- [Android] 开发资料收集:动画
- 一个不错的启动菜单显示屏动画效果
- android开机动画制作与播放原理简介
- eoe android客户端源码剖析(一)动画启动界面