Android(安卓)图片的帧动画
16lz
2022-05-16
Android之中有 Obj 动画 即 UI动画 和 Image的Fragment动画
①Image动画
将一系列图片照顺序 排列 组成一个序列展示
XML文件存放路径: res/anim/filename.xml
:
通过使用rescoure id进行访问
-
<?xml version="1.0" encoding="utf-8"?>
xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">- android:drawable="@drawable/rocket_thrust1"android:duration="200"/>
- android:drawable="@drawable/rocket_thrust2"android:duration="200"/>
- android:drawable="@drawable/rocket_thrust3"android:duration="200"/>
- android:drawable="@drawable/rocket_thrust1"android:duration="200"/>
使用动画:
ImageView rocketImage =(ImageView) findViewById(R.id.rocket_p_w_picpath)
rocketImage.setBackgroundResource
(R.drawable.rocket_thrust);
-
rocketAnimation =(AnimationDrawable) rocketImage.
getBackground()
;
rocketAnimation.start()
;
更多相关文章
- Android启动画面翻转
- Android(安卓)自定义View 使用VelocityTracker记录滑动速度
- Android(安卓)P 以及之后版本不支持同时从多个进程使用具有相同
- Android(安卓)菜单(Menu)控件的使用
- Android(安卓)Studio有关详细信息, 请使用 -Xlint:deprecation
- android 开发之旅, should use @string resource警告
- 箭头函数的基础使用
- NPM 和webpack 的基础使用
- Python list sort方法的具体使用