首页 > 技术文章 > collectionView关于点击事件

fleas 2016-07-31 20:35 原文

-(void)collectionView:(UICollectionView *)collectionView didDeselectItemAtIndexPath:(NSIndexPath *)indexPath

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath

 

didDeselectItemAtIndexPath 是取消选择点击事件

didSelectItemAtIndexPath 是点击事件

就是因为方法名称太像了,每次didDeselectItemAtIndexPath点击的都会选中上次点击的按钮

搞得我检查了半天才把问题解决 

这个坑爬的我是醉了

推荐阅读