objective-c - iOS凤凰新闻这种动画插入collectionViewCell是如何实现的?
迷茫
迷茫 2017-04-17 17:52:25
0
2
735

如图:

如图,我点击了下面某个标题,它就会以动画的方式插入到上面去。

我目前已经用LXReorderableCollectionViewFlowLayout做出了拖动排序的效果,
现在想实现这个动画插入,不知各位可提供一些思路,多谢。

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(2)
洪涛

I think it is to recalculate the position of each label, and then do a position transformation animation for each label. You can see that the rightmost one in each row moves diagonally to the first one in the next row, so it is an animation of the x and y coordinate transformation of the two positions.
Because each label has a fixed size (at least a quarter of the superview width), the position should be easier to calculate.

洪涛

UICollectionView不是自带动画的方法吗?

  • (void)insertItemsAtIndexPaths:(NSArray<NSIndexPath > )indexPaths;

  • (void)deleteItemsAtIndexPaths:(NSArray<NSIndexPath > )indexPaths;

  • (void)reloadItemsAtIndexPaths:(NSArray<NSIndexPath > )indexPaths;

  • (void)moveItemAtIndexPath:(NSIndexPath )indexPath toIndexPath:(NSIndexPath )newIndexPath;

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template