App启动动画(Splash篇)
来源:互联网 发布:联通网络优化中心 编辑:程序博客网 时间:2024/05/29 16:24
App启动动画(Splash篇)
- App启动动画Splash篇
- 简要说明
- 点此下载源码httpdownloadcsdnnetdetailu0132557379603123
简要说明
本文主要介绍如何写一个Android App 启动动画的一种方式– Splash。这种方式非常简单,话不多说,直接上代码。
1.代码如下:
activity_splash.xml
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ImageView android:id="@+id/loadImage" <!-- guide为启动动画的图片资源,自己随便找一张就行--> android:src="@drawable/guide" android:layout_width="match_parent" android:layout_height="match_parent" />" </LinearLayout>
SplashActivity.java
package com.example.loading.splash; import com.example.loading.R; import com.example.loading.Succes.SuccessLaunchActivity; import com.example.loading.Util.AnimationUtil; import com.example.loading.tools.Tools; import com.example.loading.viewPager.ViewPagerActivity; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import android.widget.ImageView; public class SplashActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash); ImageView imageView = (ImageView) findViewById(R.id.loadImage); // 设置加载动画透明度渐变从(0.1不显示-1.0完全显示) AlphaAnimation animation = new AlphaAnimation(0.1f, 1.0f); // 设置动画时间5s animation.setDuration(500); // 将组件与动画关联 imageView.setAnimation(animation); animation.setAnimationListener(new AnimationListener() { // 动画开始时执行 public void onAnimationStart(Animation animation) { // TODO Auto-generated method stub // 初始化 init(); } // 动画重复时执行 public void onAnimationRepeat(Animation animation) { // TODO Auto-generated method stub } // 动画结束时执行 public void onAnimationEnd(Animation animation) { Intent intent = new Intent(SplashActivity.this, ViewPagerActivity.class); startActivity(intent); } }); } protected void init() { // TODO 自动生成的方法存根 Tools.checkNetwork(SplashActivity.this); } }
不懂得可以加QQ:793581461 或者在下面评论,尽量及时回答。
点此下载源码:http://download.csdn.net/detail/u013255737/9603123
1 0
- App启动动画(Splash篇)
- Splash动画启动app时空白屏
- App启动动画(ViewPager篇)
- Android App启动图启动界面(Splash)的简单实现
- 启动画面(Splash Screens)
- 启动画面(Splash Screens)
- 高效启动页(Splash)
- Android APP启动界面(动画)
- iOS App启动动画
- 关于app#启动页面#splash页面#开屏广告#的小结
- Android App 启动页(Splash)黑/白闪屏现象
- 性能优化一-app启动速度及splash设计
- android 提升app启动速度以及Splash界面设计
- 3-8 启动画面(Splash Screens)
- Android应用启动-闪屏(splash)
- 【原创】 java 启动画面(闪屏)splash
- C# 制作启动画面 (Splash Screen)
- Android 启动页面制作(Splash Screen)
- Java NIO 总结与示例
- jquery文档操作处理
- [暑假集训] jzoj 2016.8.14 noip模拟赛B 总结
- C++ hdoj 2033 人见人爱A+B
- 微信接口调试总结
- App启动动画(Splash篇)
- XListViewFooter
- Java 基础问题1
- jQuery筛选
- TreeMap 排序
- 神级Coder绝不犯的错误:为炫耀编出超短码
- 2016中国大学生程序设计竞赛 - 网络选拔赛【三水题 1001 && 1004 && 1011】
- TabLayout+ViewPage+Fragment简单使用的方法
- hdu-1596-find the safest road