没有的Andr​​oid动画当从纵向活动过渡到横向活动有的、纵向、横向、动画

2023-09-12 04:55:57 作者:执着的女人,

我有一个活动被设定为纵向运行(安卓screenOrientation =肖像在该清单本次活动设置)。本次活动开启到活动B上的一个按钮的点击。活动B被设置为横向运行(安卓screenOrientation =风景清单中设置此活动)。不管我在我的overridePendingTransition方法中设置的,从未有过的动画。它总是一个硬砍。有没有办法从一个活动转变为b活动时强制某种动画?

I have Activity A which is set to run in portrait orientation (android:screenOrientation="portrait" set on this activity in the manifest). This activity opens to Activity B on a button click. Activity B is set to run in landscape orientation (android:screenOrientation="landscape" set on this activity in the manifest). Regardless of what I set in my overridePendingTransition method, there is never an animation. It's always a hard cut. Is there a way to force some sort of animation when transitioning from Activity A to Activity B?

另外,我从b活动转换时回到活性方法得到了同样的问题。

Also, I get the same issue when transitioning back from Activity B to Activity A.

编辑(从普利文):

连我都decalred的 configChanges =定向在清单中。不过我面临这个问题?在这个???任何想法

Even i have decalred the configChanges="orientation" in the Manifest. Still i am facing this Problem?? Any Idea on this???

在此先感谢

推荐答案

我认为你必须覆盖活动的onConfigurationChange方法。 也许这会帮助你。

i think you have to override activity's onConfigurationChange method. perhaps this will help you.

例如

@覆盖     公共无效onConfigurationChanged(配置NEWCONFIG){         super.onConfigurationChanged(NEWCONFIG);

@Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig);

    updateGui();
}