如何在布局动画结束时触发动画
我有一个自定义 3d 翻转,需要获取根视图来访问翻转的两个视图,如下所示: v.startAnimation(new Flip3D(v));
然后,我有一个带有 GridLayoutAnimationController 的网格布局,它加载一个简单的缩放动画。
我正在尝试的是,当布局动画结束时触发每个孩子的 3d 翻转。
是否可以?如何获取已结束动画的视图以开始 3d 动画?
我尝试的是将动画监听器附加到缩放动画并计算 onAnimationEnd 被调用的次数。每次网格视图完成动画时,我都会访问该位置的网格子级以启动 3d 翻转动画,但是它没有任何效果。
有什么想法吗?
I have a custom 3d flip that needs to get the root view to access the two views that are flipped, like this: v.startAnimation(new Flip3D(v));
Then, I have a grid layout with a GridLayoutAnimationController that loads a simple scale animation.
What i'm trying, is to trigger the 3d flip on each child when the layout animation ends.
Is it possible? How can I get the view that has ended the animation to start the 3d animation?
What I tried is to attach an animation listener to the scale animation and count how many times onAnimationEnd gets called. Each time a view of the grid finish the animation I access the grid child at that position to start the 3d flip animation but, it has no effect.
Any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您可以使用
onAnimationEnd()
请参阅此处的文档:http://developer.android.com/reference/android/view/View.html#onAnimationEnd%28%29以下是如何使用它的示例:android 动画未在 onAnimationEnd 中完成
类似:
I think you can use
onAnimationEnd()
see here the doc : http://developer.android.com/reference/android/view/View.html#onAnimationEnd%28%29Here is an example how to use it: android animation is not finished in onAnimationEnd
Something like: