基于android的Splash欢迎动画
来源:互联网 发布:php 重复的数据相加 编辑:程序博客网 时间:2024/05/21 14:52
关于Spalash,主要使用的AlphaAnimation来进行设置。这个没什么多说的了,直接上代码吧,是一个比较简单的小功能。
public class SplashActivity extends Activity { private ImageView logo; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // 取消标题 this.requestWindowFeature(Window.FEATURE_NO_TITLE); // 取消状态栏 this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_splash); logo = (ImageView) findViewById(R.id.logo); //创建一个AlphaAnimation对象,0为透明,1为不透明。 AlphaAnimation alphaAnimation = new AlphaAnimation(0.1f, 1.0f); alphaAnimation.setDuration(3000); logo.startAnimation(alphaAnimation); alphaAnimation.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { Intent intent = new Intent(); intent.setClass(SplashActivity.this, LoginActivity.class); startActivity(intent); finish(); } }); }}
然后在Manifest.xml中将Splash这个activity设置成进入程序的入口即可:
<activity android:name=".SplashActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter></activity>
完毕,效果不演示了,核心代码就这些了。
0 0
- 基于android的Splash欢迎动画
- android开场动画splash的实现
- Android 载入动画Splash的几种运用
- Android带平移动画的Splash界面Demo
- android的Splash Screen
- 【Android】Splash的使用
- android网络图片Splash欢迎页
- android 简单的欢迎动画
- iOS中Splash欢迎页面的实现
- Android进阶之路 - Splash、Welcome欢迎页面的初始使用(一)
- android的splash启动画面
- Android Splash 的最佳实践
- Android应用的欢迎界面动画实现
- Android 欢迎动画
- Android欢迎页面动画
- Android小项目之五 splash动画效果
- android splash(多用于应用开始动画)
- Android splash
- 41. 后台模块开发(6)
- node.js 系列——Buffer
- iOS提交TestFlight测试显示缺少合规证明
- DOMContentLoaded事件
- CODEFORCES 270D Greenhouse Effect <求最长递增子序列长度的对立事件>
- 基于android的Splash欢迎动画
- No Suitable Driver Found For Jdbc的解决方法
- 对CI_Security类的注释
- nginx负载均衡
- RHEL5.5_yum的安装和使用
- php数组array_filter()函数和array_slice()函数
- 最近公共祖先(1)
- escape()、encodeURI()、encodeURIComponent()区别详解
- 简单工厂 工厂方法 抽象工厂 使用方法与区别