Animation的小例子
来源:互联网 发布:常见数据库设计 编辑:程序博客网 时间:2024/06/05 11:41
1.在res文件夹中新建一个动画文件:例如 splash_anim.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha
android:fromAlpha="0"
android:toAlpha="1"
android:duration="2000"
/>
</set>
2.启动动画:
private void initAnim() {
Animation anim = AnimationUtils.loadAnimation(this, R.anim.splash_anim);
animContainer.startAnimation(anim);
// new Handler().postDelayed(new Runnable() {
//
// @Override
// public void run() {
// Intent intent = new Intent(SplashActivity.this,MainActivity.class);
// startActivity(intent);
// finish();
// }
// }, 3000);
anim.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
// TODO Auto-generated method stub
}
@Override
public void onAnimationRepeat(Animation animation) {
// TODO Auto-generated method stub
}
@Override
public void onAnimationEnd(Animation animation) {
Intent intent = new Intent(SplashActivity.this,MainActivity.class);//跳转到splashActivity界面
startActivity(intent);
finish();
}
});
}
- Animation的小例子
- 接口的小例子
- 动态的小例子
- File的小例子
- ajax的小例子
- AJAX的小例子
- innerHTML 的小例子
- Sqlite 的小例子
- cglib的小例子
- clone的小例子
- awk的小例子
- printf的小例子
- 继承的小例子
- 触发器的小例子
- 一个小的例子
- 小波的例子
- 委托的小例子
- ajax的小例子
- druid配置多数据源与分布式事务
- extern "C"的用法解析
- vmware安装无法打开内核设备 \\.\Global\vmx86: 系统找不到指定的文件
- C#桌面办公应用-工资管理系统系列四
- 腾讯的面试题,据说很多人答不上来!
- Animation的小例子
- 《Windows程序设计》读书笔六 键盘
- 数字阶梯求和
- C面试宝典——概念题
- typeahead/autocomplete
- 在eclipse中搭建struts2框架的详细过程
- 【贪心】NOIP2011观光公交详解
- Product of Array Except Self
- 6.3 径向基函数网络