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) {

      }  }

     


     

  • 相关阅读:
    修改服务器时间及时区
    风情万种awk
    追忆似水流年sed
    lvm笔记
    正则不怎么会用
    在CentOS7.5的虚拟环境下新建你的django项目
    Django学习过程中的排错总结
    我一直记不住的vim用法
    关于自建yum源拾遗
    Djangp2.x版本报错找不到模版目录下的文件
  • 原文地址:https://www.cnblogs.com/yjbjingcha/p/6918110.html
Copyright © 2011-2022 走看看