How to perform a fade animation on Activity transition?

前端 未结 4 1854
伪装坚强ぢ
伪装坚强ぢ 2020-11-30 20:13

I am codifiying a transition effect between my logo activity and my Main activity, but I have the problem that before vanish the activity move to top:



        
4条回答
  •  盖世英雄少女心
    2020-11-30 20:34

    you can also add animation in your activity, in onCreate method like below becasue overridePendingTransition is not working with some mobile, or it depends on device settings...

    View view = findViewById(android.R.id.content);
    Animation mLoadAnimation = AnimationUtils.loadAnimation(getApplicationContext(), android.R.anim.fade_in);
    mLoadAnimation.setDuration(2000);
    view.startAnimation(mLoadAnimation);
    

提交回复
热议问题