开发者

Animate GridView Children

开发者 https://www.devze.com 2023-03-31 08:08 出处:网络
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

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


You should consider using GridLayoutAnimationController. GridLayoutAnimationController docs


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.

i used android canvas and some code for positioning image tiles. it uses and data adapter pattern (like for all AdapterViews). each tile has it's position - page, row and column. draging changes tiles positions. - karooolek


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消