質問

  • 初期状態では、My Collection Viewには3つのセルがあり、1つのセクションでは、cell1cell2cell3

  • 次の状態では、最初のセルが変化し、cell1_bisになります。同じサイズです。

この変更をアニメートすることは可能です。

役に立ちましたか?

解決

回答

このように進む:

 [self.collectionView

 performBatchUpdates:^
 {
     NSIndexPath * whereTheChangeIs = [NSIndexPath indexPathForItem:row
                                                          inSection:section] ;

     [self.collectionView deleteItemsAtIndexPaths:@[whereTheChangeIs]] ;
     [self.collectionView insertItemsAtIndexPaths:@[whereTheChangeIs]] ;
 }

 completion:^(BOOL finished)
 {
     // nothing
 }] ;
.

質問

残念ながら、以下は機能しません。バグ?

 [self.collectionView

 performBatchUpdates:^
 {
     NSIndexPath * whereTheChangeIs = [NSIndexPath indexPathForItem:row
                                                          inSection:section] ;

     [self.collectionView reloadItemsAtIndexPaths:@[whereTheChangeIs]] ;
 }

 completion:^(BOOL finished)
 {
     // nothing
 }] ;
.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top