How to Reverse Fragment Animations on BackStack?

后端 未结 6 1437
日久生厌
日久生厌 2020-12-04 13:56

I thought the system would reverse animations on the backstack when the back button is pressed when using fragments using the following code:

FragmentManager         


        
6条回答
  •  [愿得一人]
    2020-12-04 14:22

    According to the android documentation for custom animation:

    Change:

    ft.setCustomAnimations(R.anim.slide_in, R.anim.hyperspace_out);
    

    To:

    ft.setCustomAnimations(R.anim.slide_in, R.anim.hyperspace_out, R.anim.hyperspace_in, R.anim.slide_out );
    

    and now the backstack animates - In reverse!!

提交回复
热议问题