2013-10-11 13 views

回答

1

将公共方法performSelectionAnimations添加到MyCollectionViewCell的定义中。然后从的CollectionView称之为:didSelectItemAtIndexPath:

-(void)performSelectionAnimations { 

... 


... 
} 

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { 
MyCollectionViewCell *cell = (MyCollectionViewCell *)[collectionView cellForItemAtIndexPath:indexPath]; 
[cell performSelectionAnimations]; 
} 

通知我取出调用[电池的setSelected:YES],因为这应该已经由UICollectionView照顾。

+0

行..我真的很高兴知道我的代码可以帮助你。 –

+0

非常感谢! – BBBBB

相关问题