像Google IO 2014 App中的活动之间的平稳过渡 [英] Smooth Transition between Activities like in the Google IO 2014 App
问题描述
我如何实现活动之间的平滑过渡,例如在 Google IO 2014 应用中实现的过渡?
How would I implement smooth Transitions between Activities such as they are implemented in the Google IO 2014 App?
似乎它们只是在替换片段,但是从代码中看起来好像它们只是定期开始一个Activity?可以在此处找到切换(导航抽屉)的源代码:
It seems as if they are just replacing Fragments but from the Code it seems as if they are just regularly starting an Activity? The Source Code for the Switching (Navigation Drawer) can be found here: BaseActivity.java
推荐答案
我刚刚发现他们如何在自己的App中实现这一目标:
I just found out how they manage to accomplish this in their App:
他们打电话
overridePendingTransition(0, 0);
从BaseActivity继承的Activity的onCreate方法中的
. (不过,您也可以在BaseActivity中调用它)
in the onCreate Methode of the Activities that inherit from the BaseActivity. (You could also call it in the BaseActivity, though)
这篇关于像Google IO 2014 App中的活动之间的平稳过渡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!