Z-Order in Shared Element Activity Transition Animations

家住魔仙堡 提交于 2019-12-23 08:36:35

问题


I am doing some basic shared element activity transition animations with code similar to this:

Intent i = new Intent(AnActivity.this, AnotherActivity.class);
ActivityOptionsCompat options =
        ActivityOptionsCompat.makeSceneTransitionAnimation(this,
                Pair.create(vBackground, "background"),
                Pair.create(vImage, "image"),
                Pair.create(vName, "name"),
                Pair.create(vDistance, "distance")
        );
startActivity(i, options.toBundle());

Can I change the Z-order that the animation assigns to the views?

The reason is that some of the views are hidden by the others during the animation, even though in both activity layouts this is not the case. Somewhere in the transition code, the Z-order of the views gets changed.

I have tried reordering the Pair.create(...) lines, but to no great success.

来源:https://stackoverflow.com/questions/41461976/z-order-in-shared-element-activity-transition-animations

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!