【发布时间】:2015-09-23 10:03:20
【问题描述】:
iOS9 为 UICollectionView 实现了一个不错的重新排序功能。
在我的 CollectionViewController 中,我实现了以下代码以使其工作:
- (void)collectionView:(UICollectionView *)collectionView moveItemAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath
{
_cells[sourceIndexPath.row][1] = [NSString stringWithFormat:@"%li", (long)destinationIndexPath.row];
_cells[destinationIndexPath.row][1] = [NSString stringWithFormat:@"%li", (long)sourceIndexPath.row];
[self saveCellorder];
}
'cells'数组只是用来保存视图中单元格的顺序
--
现在我的问题/问题:
我的 CollectionView 中有 2 个不同大小的单元格,当我将一个小单元格拖到一个小单元格上时,它们改变了位置,一切正常。当我将一个大单元格拖到一个大单元格上时也会发生同样的情况。
但是当我将一个小单元格拖到一个大单元格上时,大单元格会变小,而小单元格会变大。 我怎样才能防止细胞改变它们的大小?
【问题讨论】:
标签: ios objective-c uitableview ios9