transaction.setCustomAnimations()
来实现动画切换效果,试了一下,结果没成,纠结半天,在SO上发现有人遇到过这个问题,然后自己给解决了:
http://stackoverflow.com/a/11108301 原因大概是这样子的:
The manager was stacking my transaction before I set the animation, so it stacks the transaction without animations (sad but true), and that occurs even with if I commit the transaction after the setCustom() method.所以setCustomAnimations()需要在replace/add/remove之前调用,动画才有效果。