I want to animate the removal of fragment.
I tried:
getSupportFragmentManager().beginTransaction()
.setCustomAnimations(R.anim.push_down_in, R.anim.push_up_out)
.remove(myFragment)
.commit();
but the fragment just disappears.
I noticed the out animation only plays with 'replace', so I tried to replace the fragment with an empty Fragment like this:
getSupportFragmentManager()
.beginTransaction()
.setCustomAnimations(R.anim.push_down_in, R.anim.push_up_out)
.replace(viewId, new Fragment())
.commit();
But it still just disappears disappears.
So, how can I animate the removal of fragment?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…