更新时间:2022-02-10 16:15:20
试试这个:
首先,确保你给每个的ImageView
在你的第一个活动的唯一过渡名称。如果所有的图像视图具有相同名称的过渡,该框架将不知道什么时候开始的动画和过渡将不会循规蹈矩该选哪一个。
First, make sure you give each ImageView
in your first activity a unique transition name. If all of the image views have the same transition name, the framework will not know which one to choose when the animation begins and the transition will not behave properly.
在的ImageView
点击,通过其独特的过渡的名字到细节的活动为意图
多余的。
When the ImageView
is clicked, pass its unique transition name to the details activity as an Intent
extra.
在细节活动的的onCreate()
方法,从意图包检索名称,将其设置为的ImageView
的临时名字。
In the details activity's onCreate()
method, retrieve the name from the intent bundle, and set it as the ImageView
's transition name.