How to Reverse Fragment Animations on BackStack?

后端 未结 6 1480
日久生厌
日久生厌 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:26

    in my case

    fragmentTransaction.setCustomAnimations(android.R.anim.slide_in_left, android.R.anim.slide_out_right, 
                           R.anim.slide_in_right, R.anim.slide_out_left);
    

    would create perfect animation.

    slide_in_right

    
    
        
        
    
    

    slide_out_left

    
    
        
        
    
    

提交回复
热议问题