新浪微博开发知识重点整理

来源:互联网 发布:重庆软件行业协会地址 编辑:程序博客网 时间:2024/05/17 13:45

一、实现开启APP载入是的动画渐进效果

        requestWindowFeature(Window.FEATURE_NO_TITLE);//去除标题
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);//去除多最上面的消息显示层,如时间电量等
        setContentView(R.layout.logo);
        imageLogo=(ImageView)findViewById(R.id.img_logo);
        AlphaAnimation animation=new AlphaAnimation(0.0f,1.0f);//0.0f表示完全透明,1.0f表示完全不透明,在0.0到1.0之间浮动
        animation.setDuration(3000);//设置过3秒显示或者完全消失
        //点击单个控件的时候,使用监听器
        animation.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {


            }


            @Override
            public void onAnimationEnd(Animation animation) {
                //结束后实现页面的跳转
                Intent intent=new Intent(MainActivity.this,LoginActivity.class);
                startActivity(intent);


            }


            @Override
            public void onAnimationRepeat(Animation animation) {


            }
        });
        imageLogo.setAnimation(animation);//imageview实例调用方法实现缓慢出现


    }



0 0
原创粉丝点击