安卓欢迎页的写法
来源:互联网 发布:eia原油库存数据行情 编辑:程序博客网 时间:2024/05/17 22:56
layout :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:background="#fff"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageView
android:id="@+id/imageView_welcome"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/wellcom" />
</LinearLayout>
java:
public class Wellcom extends Activity implements AnimationListener{
private ImageView imageView = null;
private Animation alphaAnimation = null;
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.wellcome);
imageView = (ImageView)findViewById(R.id.imageView_welcome);
alphaAnimation = AnimationUtils.loadAnimation(this, R.anim.welcom_alpha);
alphaAnimation.setFillEnabled(true); //启动Fill保持
alphaAnimation.setFillAfter(true); //设置动画的最后一帧是保持在View上面
imageView.setAnimation(alphaAnimation);
alphaAnimation.setAnimationListener(this); //为动画设置监听
}
public void onAnimationEnd(Animation animation) {
//动画结束时结束欢迎界面并转到软件的主界面
Intent intent = new Intent(this, Bluetoothoyl.class);
startActivity(intent);
this.finish();
}
public void onAnimationRepeat(Animation animation) {
// TODO Auto-generated method stub
}
public void onAnimationStart(Animation animation) {
// TODO Auto-generated method stub
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
//在欢迎界面屏蔽BACK键,在退出的时候就不会返回这个欢迎页
if(keyCode==KeyEvent.KEYCODE_BACK) {
return false;
}
return false;
}
}
anim:
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator">
<alpha
android:fromAlpha="0.0"
android:toAlpha="1.0"
android:duration="500"
/>
<alpha
android:fromAlpha="1.0"
android:toAlpha="0.2"
android:startOffset="1000"
android:duration="300"
/>
</set>
- 安卓欢迎页的写法
- 安卓悬浮窗的写法
- 安卓接口回调的写法
- 安卓线程切换优雅的写法
- 安卓Viewpager的使用--简单的欢迎页
- 安卓开发中应用欢迎页的简单实现
- 安卓开发中应用的欢迎页怎么实现?
- 安卓欢迎界面的编写
- 安卓欢迎页停留几秒跳到主界面
- 【Android】安卓设置欢迎页
- 安卓生成主页欢迎页
- 安卓常用代码写法
- 安卓四大事件写法:
- 安卓基础-点击事件的几种写法
- 安卓按钮点击事件的四种写法
- 安卓欢迎页和phonegap安卓欢迎页制作
- 安卓欢迎界面和activity之间的跳转问题
- 安卓软件的欢迎界面,只显示一次。
- MATLAB内存溢出的解决办法
- numpy教程:数学函数和基本统计函数
- host文件的工作原理及应用
- 1024. Palindromic Number (25)
- STL 之 list源代码自行实现(iterator)
- 安卓欢迎页的写法
- Word Break (leedcode)
- 实时系统HBase读写优化--大量写入无障碍
- HDU 1016 Prime Ring Problem
- 卸载软件的注意点——注册表
- 访问者模式 (visitor pattern)
- 论文笔记1
- Genymotion与电脑传输文件
- C语言访问MySQL数据库的方法