开机动画 看图学Android---Android 开发实例教程五
来源:互联网 发布:mac 鼠标右键不能用 编辑:程序博客网 时间:2024/05/20 11:26
Android实例图解教程目录
http://blog.csdn.net/wyx100/article/details/45061407
在《开发一个新的android界面、界面跳转 看图学Android---Android 开发实例教程三、四》基础完成开机动画,开机界面的图片,在5.5秒内逐渐消失,显示主界面。
只修改StartActivity.java中代码以下部分
StartActivity.java源代码
package com.example.helloword;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.os.Handler;import android.view.animation.AlphaAnimation;import android.view.animation.AnimationSet;import android.widget.ImageView;public class StartActivity extends Activity {/** Called when the activity is first created. */ private final int SPLASH_DISPLAY_LENGHT = 3000; //延迟三秒 private ImageView image=null;@Overridepublic void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.start); image=(ImageView)findViewById(R.id.imageView1); AnimationSet animationset=new AnimationSet(true); AlphaAnimation alphaAnimation=new AlphaAnimation(1, 0);//AlphaAnimation(1, 0)图片逐渐变成透明,1指透明度为0%,0指透明度100% alphaAnimation.setDuration(5500); animationset.addAnimation(alphaAnimation); image.startAnimation(animationset); new Handler().postDelayed(new Runnable(){ @Override public void run() { Intent mainIntent = new Intent(StartActivity.this,MainActivity.class); //界面跳转定义 StartActivity.this.startActivity(mainIntent); //启动界面跳转 StartActivity.this.finish(); //界面跳转完成后,消除界面一 } }, SPLASH_DISPLAY_LENGHT); //界面一显示时长}}
0 0
- 开机动画 看图学Android---Android 开发实例教程五
- android 系统开发之开机动画
- android 开机logo 开机动画
- Android 开机动画
- Android 开机动画
- android 开机动画
- android 开机动画
- android开机动画
- android 开机动画修改
- Android开机动画
- Android开机动画过程
- android开机动画
- Android修改开机动画
- Android开机动画详解
- Android 开机logo动画
- Android开机动画过程
- android 开机关机动画
- 制作android开机动画
- ZOJ3876:May Day Holiday(浙江省赛2015)
- 【缓冲区溢出】EasyRMtoMP3Converter.exe stack overflow bypass dep using rop tech
- 不使用setPositiveButton 如何让alertdialog消失
- UNIX基础--权限
- 第六题
- 开机动画 看图学Android---Android 开发实例教程五
- Windows环境制作黑苹果U盘图文教程
- 【POJ】3225 线段树 + 离散化 + 区间交并
- 《C语言及程序设计》实践项目——发现Bug
- UNIX基础--磁盘组织
- 蓝桥杯 错误票据
- 2015年大一下第6周项目1-实现复数类中的运算符重载
- ZOJ3875:Lunch Time(浙江省赛2015)
- 第五题