Make new activity appear behind old one during transition

前端 未结 3 1154
有刺的猬
有刺的猬 2020-11-29 20:23

What I\'m trying to achieve is to override the start activity animation.

The animation should give the impression that the old activity is on top of the new activity

3条回答
  •  庸人自扰
    2020-11-29 21:02

    I've been trying to solve your solution in a sample project and I got it working with this code:

    Call the animation with:

    startActivity(new Intent(this, Activity2.class));
    overridePendingTransition(R.anim.push_down_in,R.anim.push_down_out);
    

    R.anim.push_down_in:

      
      
      
      
    

    R.anim.push_down_out:

      
      
      
      
    

提交回复
热议问题