且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Android的棒棒糖一个ListView与材料设计活动过渡动画

更新时间:2022-02-10 16:15:20

试试这个:


  1. 首先,确保你给每个的ImageView 在你的第一个活动的唯一过渡名称。如果所有的图像视图具有相同名称的过渡,该框架将不知道什么时候开始的动画和过渡将不会循规蹈矩该选哪一个。

  1. 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.