android动画实现-Frame animation(二)
来源:互联网 发布:淘宝卖家跑哪去了 编辑:程序博客网 时间:2024/05/16 10:18
第一步:创建动画文件animation_1
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<!---四个动画图片->
<item android:drawable="@drawable/aa1" android:duration="60" />
<item android:drawable="@drawable/aa2" android:duration="60" />
<item android:drawable="@drawable/aa3" android:duration="60" />
<item android:drawable="@drawable/aa4" android:duration="60" />
</animation-list>
第二步:布局文件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<ImageView
android:id="@+id/im"
android:background="@anim/animation_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
第三步:测试
public class AnimationTestActivity extends Activity {
private ImageView im=null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
im=(ImageView)findViewById(R.id.im);
//im.setBackgroundResource(R.anim.animation_1);
final AnimationDrawable ad= (AnimationDrawable)im.getBackground();
im.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ad.start();
}
});
}
}
- android动画实现-Frame animation(二)
- android开发动画总结二(frame animation)
- android动画实现-Frame animation(一)
- Android动画--Frame Animation
- Android[动画] Frame Animation
- android动画-Frame Animation
- android动画-Frame Animation
- 动画效果二 ----Frame Animation
- Frame Animation动画的实现
- Android基础夯实--重温动画(二)之Frame Animation
- Android 动画专题--- Frame Animation
- 【UX】Android动画 - Frame Animation
- Android 动画专题--- Frame Animation
- Android动画之Frame Animation
- Android 动画(二)-Drawable Animation(Frame Animation)、Property Animation
- Animation动画(二)---- Frame 帧动画
- android 动画 Tween animation Frame animation
- Animation---详解Android动画之Frame Animation
- Proactor和Reactor模式_继续并发系统设计的扫盲
- C#实现 获取IPv4
- xcode常用快捷键
- Fms3和Flex打造在线多人视频会议和视频聊天(附原代码)<视频聊天,会议开发实例3>
- Smarty中的自定义函数(二)复选框、下拉列表、单选框
- android动画实现-Frame animation(二)
- 关于Hbase应用的一点实践经验
- 演练:创建和部署使用 SQL CLR 对象的数据库项目
- Oracle 11g存在密码过期问题
- ArcGIS Server网站发布后地图显示空白
- OPENGL常用的几个函数
- zoj 1090 The Circumference of the Circle
- 集成struts2 spring hibernate中使用注解
- RFC1035域名随机生成测试代码