I want to tap the cell of the UICollectionView and the cell becomes half transparent.
- (void)collectionView:(UICollectionView *)collectionView
didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
GLEpisodeCell *cell=[collectionView dequeueReusableCellWithReuseIdentifier:[GLEpisodeCell identifier] forIndexPath:indexPath];//GLEpisodeCell is subclass of UICollectionViewCell
cell.alpha=0.5;
cell.contentView.alpha=0.5;
}
But this doesn't work. The cell is still opacity.
Try like this it might help you.
- (void)collectionView:(UICollectionView *)collectionView
didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
GLEpisodeCell *cell=[collectionView cellForItemAtIndexPath:indexPath];//GLEpisodeCell is subclass of UICollectionViewCell
cell.alpha=0.5;
cell.contentView.alpha=0.5;
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments