android animation 零碎总结
来源:互联网 发布:java date sethour 编辑:程序博客网 时间:2024/05/01 08:04
第一步
此段代码放在新建的drawable文件夹下
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false"><item android:duration="150" android:drawable="@drawable/ic_dialpad" ></item>
<item android:duration="150" android:drawable="@drawable/ic_edit" ></item>
<item android:duration="150" android:drawable="@drawable/ic_expand"></item>
<item android:duration="150" android:drawable="@drawable/ic_launcher" ></item>
<item android:duration="150" android:drawable="@drawable/ic_minus" ></item>
</animation-list>
第二步
在layou文件中
<ImageView
android:src="@drawable/anima" />
一定要做引用
第三步
java代码中
ImageView imageView=(ImageView) findViewById(R.id.imageView1);
AnimationDrawable animationDrawable= (AnimationDrawable) imageView.getDrawable();
animationDrawable.start();
第二种方法,不在xml文件中设置,直接在代码中设置
imageView_splash=(ImageView) findViewById(
R.id.imageView_splash);
//在此处设置
imageView_splash.setBackgroundResource(R.drawable.load_anim);
AnimationDrawable drawable =(AnimationDrawable) imageView_splash.getBackground();
drawable.start();
//界面跳转
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent intent=new Intent(
SplashActivity.this,
MainActivity.class);
startActivity(intent);
finish();
}
}, 3000);
}
- android animation 零碎总结
- android 零碎知识总结
- Android零碎知识点总结
- android零碎知识点总结
- android零碎知识总结
- Android Animation学习总结
- Android Animation总结
- Android总结之Animation
- Android Animation动画总结
- 零碎总结
- Android的 animation (总结)
- Android Animation的用法总结
- Android 零碎
- android 零碎
- Android 零碎
- android 零碎
- Android中Animation的使用总结
- Android 高级动画总结(Property Animation)
- PHP——CURL类
- PROCEDURE-12
- HTTP详解(1)-工作原理
- HDU 1014 Uniform Generator 水题
- 掌握shell应用,Linux 任你行走!
- android animation 零碎总结
- hdu 2519 - 求解组合数
- cnetos 6.5 32bit oracle安装
- C# 中的一些 基本语句,循环的格式.1
- PAT B1030
- #sicily#1003.campus
- USB驱动程序之USB设备驱动程序2鼠标用作键盘学习笔记
- 通过设置文件HTTP header来实现下载文件自动重命名
- USACO 3.1 Agri-Net 最短网络 (最小生成树)(改)