gpt4 book ai didi

Android 转换 : Go to other scene without animation on orientation change

转载 作者:行者123 更新时间:2023-11-29 01:28:01 24 4
gpt4 key购买 nike

我有两个 Scenes在我的布局中。

首先是 Activity View 膨胀的原始场景。

另一个是使用 TransitionManager.go(secondScene);

将第一个转换到的场景

现在,当设备旋转时,正如预期的那样,整个过渡会再次播放。我想阻止这个,想直接展示第二个场景。我的 savedInstanceState 中有所有数据,所以我知道 Activity 已重新创建,但我不知道如何在没有动画的情况下直接显示第二个状态。

如有任何帮助,我们将不胜感激。谢谢。

最佳答案

你为 TransitionSet 设置了 null

TransitionManager.go(secondScene, null);

sceneRoot.removeAllViews();
View scene = inflate(getContext(),R.layout.second_scene, null);
sceneRoot.addView(scene);

关于Android 转换 : Go to other scene without animation on orientation change,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32805730/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com