如何在 Android 应用程序中一次更改所有活动转换? [英] How to change all the activity transitions at once in Android application?

查看:46
本文介绍了如何在 Android 应用程序中一次更改所有活动转换?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我可以在 startActivity() 或 finish() 之后立即使用以下代码更改活动转换

I know I can change activity transition using the following code right after startActivity() or finish()

activity.overridePendingTransition(R.anim.activity_close_enter, R.anim.activity_close_exit);

但是如果我的应用中有十个活动,我必须这样做十次;并且很难修改.所以我想知道是否有办法一次为应用程序中的所有活动设置转换.AndroidManifest.xml 中是否有相应的配置?

But if I have ten activities in my app, I have to do that ten times; and it is quite hard to modify. So I'm wondering if there is a way to set transition for all activities within the application at once. Is there any corresponding configuration in AndroidManifest.xml?

谢谢!

推荐答案

你想先在 res/styles.xml 中创建一个