android 开机动画
2016-03-16 15:25
393 查看
1、设置动画布局文件(在drawable中添加xml文件)
<?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/p1" android:duration="200"/>
<item android:drawable="@drawable/p2" android:duration="200"/>
<item android:drawable="@drawable/p3" android:duration="200"/>
<item android:drawable="@drawable/p4" android:duration="200"/>
<item android:drawable="@drawable/p5" android:duration="200"/>
<item android:drawable="@drawable/p6" android:duration="200"/>
</animation-list>
2、播放动画
//设置开机动画
ImageView iv=(ImageView) findViewById(R.id.iv);
iv.setBackgroundResource(R.drawable.start_animation);
AnimationDrawable ad=(AnimationDrawable) iv.getBackground();
ad.start();
<?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/p1" android:duration="200"/>
<item android:drawable="@drawable/p2" android:duration="200"/>
<item android:drawable="@drawable/p3" android:duration="200"/>
<item android:drawable="@drawable/p4" android:duration="200"/>
<item android:drawable="@drawable/p5" android:duration="200"/>
<item android:drawable="@drawable/p6" android:duration="200"/>
</animation-list>
2、播放动画
//设置开机动画
ImageView iv=(ImageView) findViewById(R.id.iv);
iv.setBackgroundResource(R.drawable.start_animation);
AnimationDrawable ad=(AnimationDrawable) iv.getBackground();
ad.start();
相关文章推荐
- ListView 中关于checkBox的复用出错问题,个人总结的
- android中跨进程debug
- 【Android】三种工厂模式简析
- android 自定义 ProgressBar (类似微博拍摄视频进度条)
- Android让一个service开机自动启动
- Android:Service完全解析(三)
- Android:Service完全解析(二)
- Android:Service完全解析(一)
- Android5.0系统 知识点总结(持续更新)
- ava.lang.IllegalStateException The specified child already has a parent. You must call removeView()
- 5_理解RemoteView
- Android后台发送短信
- 2016.3.15Android 学习汇总
- Android异步消息处理机制
- Android Studio Log
- Android系统之路(初识MTK) ------ OTA打包ROM安装系统img等到ZIP
- Android设计模式-适配器模式
- 【DeskClock】开机闹钟横竖屏显示不同
- Android Studio的目录结构图文介绍
- Android学习系列(39)--Android主题和样式之系统篇(上)