如图:
如图,我点击了下面某个标题,它就会以动画的方式插入到上面去。
我目前已经用LXReorderableCollectionViewFlowLayout
做出了拖动排序的效果,
现在想实现这个动画插入,不知各位可提供一些思路,多谢。
PHP中文网2017-04-17 17:54:25
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.
PHP中文网2017-04-17 17:54:25
UICollectionView不是自带动画的方法吗?
(void)insertItemsAtIndexPaths:(NSArray<NSIndexPath > )indexPaths;
(void)deleteItemsAtIndexPaths:(NSArray<NSIndexPath > )indexPaths;
(void)reloadItemsAtIndexPaths:(NSArray<NSIndexPath > )indexPaths;
(void)moveItemAtIndexPath:(NSIndexPath )indexPath toIndexPath:(NSIndexPath )newIndexPath;