2
我有一個集合單元格,並且想要在觸摸時更改圖像,並且再次返回,我應該如何構造它?水龍頭集合查看單元格更改圖像
突出顯示(效果良好)後,我想讓它在再次觸摸時回到舊圖像。謝謝。在viewWillDissapear我想知道哪些單元格突出顯示。
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
UIImage *backGround =[UIImage imageNamed:@"IconHighlight.png"];
UIImageView *av = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, backGround.size.width, backGround.size.height)];
av.backgroundColor = [UIColor clearColor];
av.opaque = NO;
av.image = backGround;
[[collectionView cellForItemAtIndexPath:indexPath] setBackgroundView:av];
[[collectionView cellForItemAtIndexPath:indexPath].backgroundView setTag:1];
}