UICollectionView - didDeselectItemAtIndexPath not called if cell is selected

后端 未结 7 1598
面向向阳花
面向向阳花 2020-12-01 09:12

The first thing I do is to set the cell selected.

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndex         


        
7条回答
  •  攒了一身酷
    2020-12-01 09:52

    Add this line to your didSelectItemAtIndexPath method

    [collectionView selectItemAtIndexPath:indexPath animated:NO scrollPosition:nil]
    

提交回复
热议问题