android-Drawable Animation
来源:互联网 发布:编程与cnc编程 编辑:程序博客网 时间:2024/05/23 19:16
Drawable animation lets you load a series of Drawable resources one after another to create an animation. This is a traditional animation in the sense that it is created with a sequence of different images, played in order, like a roll of film. The AnimationDrawable
class is the basis for Drawable animations.
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="true"> <item android:drawable="@drawable/rocket_thrust1" android:duration="200" /> <item android:drawable="@drawable/rocket_thrust2" android:duration="200" /> <item android:drawable="@drawable/rocket_thrust3" android:duration="200" /></animation-list>
Here's an example Activity, in which the animation is added to anImageView
and then animated when the screen is touched:
AnimationDrawable rocketAnimation;public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ImageView rocketImage = (ImageView) findViewById(R.id.rocket_image); rocketImage.setBackgroundResource(R.drawable.rocket_thrust); rocketAnimation = (AnimationDrawable) rocketImage.getBackground();}public boolean onTouchEvent(MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { rocketAnimation.start(); return true; } return super.onTouchEvent(event);}
0 0
- Android-animation-drawable Animation
- Android Drawable Animation 学习
- Android之Drawable Animation
- android-Drawable Animation
- Android动画-Drawable Animation
- Drawable Animation(Android动画)
- 【Android基础知识】Drawable Animation和View Animation
- Android Animation——drawable animation
- Android绘图动画---Drawable Animation
- Android动画之Drawable Animation
- Android动画之一:Drawable Animation
- Android动画之一:Drawable Animation
- Android动画之一:Drawable Animation
- Android帧动画Drawable Animation
- Android 动画(2) Drawable Animation
- Android API Guides---Drawable Animation
- Android动画之一:Drawable Animation
- Android动画之一:Drawable Animation
- ASP采集-ASP采集程序原理
- 在64位计算机上安装32位iis访问access
- Eclipse发布web项目不成功的原因
- java nexus
- json过程的精度缺失问题
- android-Drawable Animation
- Android学习第七天————通过android提供的XmlPullParserFactory解析XML文件
- Android按钮点击事件
- tomcat 配置
- git 撤销修改篇
- HDOJ--2010
- 一个asp采集程序类
- SVN服务器搭建
- 12月15日,progress_dispaly