如何使UICollectionView
細胞忽略位置變化時,其他細胞重新排序?如何使UICollectionView的細胞忽略位置變化時,其他細胞重新排序?
例如
Inital細胞
=========小區1小區2小區3小區4 ==========
移動小區4到小區1,這將是
=========小區4小區1小區2小區3 ==========
現在,我想到忽略小區3位置變化,它應該是
=========小區4小區1小區3小區2 ==========
我使用這個API進行重新排序:
- (void)moveItemAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)newIndexPath;
我想做的事情和交換兩個單元格之間有些不同。我想只有一個單元格不會改變位置 –
** [self moveItemAtIndexPath:fromIp toIndexPath:toIp]; ** ---> cell4 to cell1 ** [self moveItemAtIndexPath:toIp + 2 toIndexPath:toIp + 3]; ** ---> cell2到cell3 ** [self moveItemAtIndexPath:toIp + 3 toIndexPath:toIp + 2]; ** ---> cell3到cell2。我們認爲你需要如何做這些多位置切換。我想這部分是合乎邏輯的,就像你想要移動的位置和位置。 – user3300864