我正在尝试在不同活动的不同片段下实现共享元素转换,这些片段中包含了两个 FixedAspectImageView。目标也在 NestedScollView 下。
发生的一切只是在 Fragment1 中的轻微过渡和稍后在 Activity2 中加载 Fragment2 时的闪烁。
由于这些元素位于不同活动的片段下,因此已经尝试在 Activity2 的 onCreate 方法中使用 postponeEnterTransition() 方法,在 Fragment2 的 onCreateView 方法中使用 startPostponedEnterTransition() 方法。
发生的一切只是在 Fragment1 中的轻微过渡和稍后在 Activity2 中加载 Fragment2 时的闪烁。
由于这些元素位于不同活动的片段下,因此已经尝试在 Activity2 的 onCreate 方法中使用 postponeEnterTransition() 方法,在 Fragment2 的 onCreateView 方法中使用 startPostponedEnterTransition() 方法。
OriginLayout:
<CardView>
<LinearLayout>
<FrameLayout>
<FixedAspectImageView>
transitionName:"image"
DestinationLayout:
<FrameLayout>
<NestedScrollView>
<LinearLayout>
<FrameLayout>
<FixedAspectImageView>
transitionName:"image"