对 GridView 子项进行动画处理
我想知道是否有一种方法可以将 GridView 的子项动画设置到新位置。因此,例如,从左侧滑入,当到达一行末尾时,向右滑出。这将产生每个孩子移动到新位置的效果,而不仅仅是出现在那里。
我环顾四周,没有找到任何有用的信息。理想情况下,一个小的代码示例将帮助我上路。
谢谢
I was wondering if there is a way that I can animate my GridView's Children to their new positions. So, for example, slide in from the left and when at the end of a row, slide off to the right. This will give the effect of each child moving to its new position, rather than just appearing there.
I have looked around, and could not find any useful information. Ideally a small code sample will get me on my way.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您应该考虑使用 GridLayoutAnimationController 。 GridLayoutAnimationController 文档
You should consider using
GridLayoutAnimationController
. GridLayoutAnimationController docs您可以尝试观看这个视频:
http://www.youtube.com/watch?v=X984r7IOrgc
开发者以某种方式分享他在对其中一条评论的回复中是如何实现动画的。不过他还不能展示源代码。希望这有帮助。
You may try looking at this video:
http://www.youtube.com/watch?v=X984r7IOrgc
The developer somehow shares how he had implemented the animation in his reply on one of the comments. He could not show the source code yet though. Hope this helps.
Android API Demo中有一些动画,包括一些gridview的动画。
您可能想查看 com.example.android.apis.view 中的示例。
There are a few animations in the Android API Demo, including some animations for gridview.
You might want to check the examples in com.example.android.apis.view.