Android创建逐帧动画的方式
来源:互联网 发布:醉仙武坐骑进阶数据 编辑:程序博客网 时间:2024/05/17 04:22
<?xml version="1.0" encoding="utf-8"?> <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="true" > <item android:drawable="@drawable/c1" android:duration="200"/> <item android:drawable="@drawable/c2" android:duration="200"/> <item android:drawable="@drawable/c3" android:duration="200"/> <item android:drawable="@drawable/c4" android:duration="200"/> <item android:drawable="@drawable/c5" android:duration="200"/> <item android:drawable="@drawable/c6" android:duration="200"/> </animation-list>
动画的xml文件
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:paddingTop="50dp" > </ImageView> <Button android:id="@+id/button2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:text="Run" android:onClick="run"> </Button> </LinearLayout>
布局文件
protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); this.setContentView(R.layout.contextmenu); imageView = (ImageView) findViewById(R.id.imageView1); imageView.setBackgroundResource(R.anim.animation_list); draw = (AnimationDrawable) imageView.getBackground(); // draw = (AnimationDrawable) imageView.getDrawable(); } [java]public void run(View v) { if (draw.isRunning()) { draw.stop(); } else { draw.stop(); draw.start(); } }
java文件
- Android创建逐帧动画的方式
- 创建android逐帧动画的两种方式
- 创建android逐帧动画的两种方式 布局和java代码
- android中帧动画的实现方式
- Cocos2dx帧动画的两种创建方式
- Cocos2dx帧动画的两种创建方式
- cocos2dx 帧动画的两种创建方式
- cocos2dx 帧动画的两种创建方式
- cocos2dx 创建动画的几种方式
- Android动画之帧动画实现方式
- android帧动画实现方式
- Android帧动画创建方法
- android 帧动画的四种启动方式
- Android Tween动画的四种方式
- Android动画播放的常用方式
- Android动画的两种使用方式。
- Android实现动画的实现方式
- Android中几种特殊的动画设置方式
- Java算法学习(查找数字)
- 把M位的2^M种不同的0-1串按圆排列划分(3)终结
- Spring事务的传播行为和隔离级别
- WCHAR我不再惧怕了
- 2012-10-15 origin和图像depth之间的转换
- Android创建逐帧动画的方式
- MyEclipse 8.6 download 官方下载地址
- zoj 1151.Word Reversal
- Python Pycurl 多线程段错误
- POJ2230
- 制造自己的wave音频播放器-使用waveOutOpen与waveOutWrite实现
- 刺青的伤感爱情空间日志推荐:再见了,我的曾经
- apache2.2.22+tomcat6.0.35负载均衡和session复制
- Myeclipse的各个操作总结