帧动画
来源:互联网 发布:python json 美化输出 编辑:程序博客网 时间:2024/06/15 16:51
动画anima.xml文件(在drawable目录下):
oneshot表示执行次数,当为false时则表示只执行一次,当为true时表示循环执行
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"android:oneshot="false"> <item android:drawable="@drawable/pic_1 android:duration="200"/> <item android:drawable="@drawable/pic_2 android:duration="200"/> <item android:drawable="@drawable/pic_3 android:duration="200"/> <item android:drawable="@drawable/pic_4 android:duration="200"/></animation>
布局文件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> <ImageView android:id="@+id/iv_test" android:layout_width="wrap_content" android:layout_height="wrap_content"/></LinearLayout>
java代码:
...code.. ImageView ivTest = (ImageView)findViewById(R.id.iv_test); ivTest.setBackgroundResource(R.drawable.anima); AnimationDrawable ad = (AnimationDrawable)ivTest.getBackground();//获取帧动画对象 ad.start();....code...
0 0
- 动画__帧动画
- 转场动画 帧动画
- 动画 AnimationDrawable 帧动画
- 动画----帧动画
- 安卓补间动画、帧动画
- Android动画-帧动画
- Android动画--帧动画
- egret_gif动画(帧动画)
- android动画 -- 帧动画 补间动画
- 属性动画,补间动画,帧动画
- View动画、帧动画、属性动画
- Android动画-帧动画&补间动画
- Android加载动画 旋转动画 、帧动画
- 帧动画、补间动画、属性动画
- 动画(过渡动画、关键帧动画)
- Android动画-帧动画-属性动画
- 帧动画&补间动画&属性动画
- 安卓 动画帧动画基础动画
- tsql default values, check current isolation level, check db object last update time
- 阶乘的长度
- boost 安装
- Mysql数据库常用语句笔记
- 二级指针内存模型
- 帧动画
- 全局变量报错:UnboundLocalError: local variable 'l' referenced before assignment
- 关于layout布局中的变量
- 夏日饮食安全小调整
- 项目NDK配置
- SQL Server AlwaysOn架构及原理
- Oracle下的Databse,Instance,Schemas
- 待整理文档
- 正则表达式创建数字号码匹配器