zoukankan      html  css  js  c++  java
  • Android 应用启动动画代码

    requestWindowFeature(Window.FEATURE_NO_TITLE);//设置无标题
    setContentView(R.layout.activity_main);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);//设置全屏
    ImageView welcomeImg = (ImageView) findViewById(R.id.iv);//启动时显示的图片
    AlphaAnimation anima = new AlphaAnimation(0.3f, 1.0f);//创建一个透明度从0.3 慢慢到不透明的原图的动画效果
    anima.setDuration(3000);// 设置动画显示时间
    welcomeImg.startAnimation(anima);//设置启动时图片的动画
    anima.setAnimationListener(new AnimationImpl());//设置动画监听
     private class AnimationImpl implements AnimationListener {//动画监听

      @Override   public void onAnimationStart(Animation animation) { //   welcomeImg.setBackgroundResource(R.drawable.ic_launcher);   }

      @Override   public void onAnimationEnd(Animation animation) {    Intent intent = new Intent(MainActivity.this, OtherActivity.class);

       startActivity(intent);    finish();   }

      @Override   public void onAnimationRepeat(Animation animation) {

      }  }

     


     

  • 相关阅读:
    测试杂谈
    使用jQuery完成表单验证
    session&&cookie
    jQuery中关于toggle的使用
    Regist&Login
    关于线程的面试题
    成语验证码所需素材
    验证码测试-demo
    java动态生成验证码图片
    servlet-向页面输出中文出现乱码处理方式
  • 原文地址:https://www.cnblogs.com/yjbjingcha/p/6918110.html
Copyright © 2011-2022 走看看