change UICollectionView cell's alpha value not working

Han Pengbo

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.

Vishnuvardhan

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

iOS: UICollectionView cell selection not working

From Dev

Change Background of UICollectionView Cell on Tap

From Dev

UICollectionView : how to animate the change of a cell?

From Dev

UICollectionView : how to animate the change of a cell?

From Dev

uicollectionview scrolling change cell indexpath

From Dev

Change cell border color in UICollectionView?

From Dev

UICollectionView, Cell selection not working, cell scrolls fine

From Dev

UICollectionView, Cell selection not working, cell scrolls fine

From Dev

How to change a cell's value in dataframe with pySpark?

From Dev

VBA : How to change the cell's value in a function?

From Dev

Datagrid change a cell value if it's default(dateTime)

From Dev

Change a cell's color on value of another cell, then change to a different color if I put a value into the cell

From Dev

Change background's alpha value based on screen brightness

From Dev

Change background's alpha value based on screen brightness

From Dev

UICollectionView's cell registerClass in Swift

From Dev

Change button's background alpha without changing the text alpha value in Android?

From Dev

Custom Delegate For UICollectionView Cell - Custom Button Not working

From Dev

Will UICollectionView change the cell's selected property to true before sending didSelectItemAtIndexPath delegate method?

From Dev

UICollectionView Cell with Image, change Background with click

From Dev

Change the image of a specific cell inside a UICollectionView

From Dev

UICollectionView: change the sizeForItemAtIndexPath from within custom cell

From Dev

Change UINavigationbar title according to UICollectionView Cell

From Dev

UICollectionView Cell with Image, change Background with click in Swift

From Dev

Change Cell Value if There is Overflow

From Dev

Cell value change with Month

From Dev

Change value of cell in Javascript

From Dev

Change value in a cell based on value in another cell

From Dev

Does changing alpha value change text?

From Dev

How to change alpha value along with scrolling

Related Related

  1. 1

    iOS: UICollectionView cell selection not working

  2. 2

    Change Background of UICollectionView Cell on Tap

  3. 3

    UICollectionView : how to animate the change of a cell?

  4. 4

    UICollectionView : how to animate the change of a cell?

  5. 5

    uicollectionview scrolling change cell indexpath

  6. 6

    Change cell border color in UICollectionView?

  7. 7

    UICollectionView, Cell selection not working, cell scrolls fine

  8. 8

    UICollectionView, Cell selection not working, cell scrolls fine

  9. 9

    How to change a cell's value in dataframe with pySpark?

  10. 10

    VBA : How to change the cell's value in a function?

  11. 11

    Datagrid change a cell value if it's default(dateTime)

  12. 12

    Change a cell's color on value of another cell, then change to a different color if I put a value into the cell

  13. 13

    Change background's alpha value based on screen brightness

  14. 14

    Change background's alpha value based on screen brightness

  15. 15

    UICollectionView's cell registerClass in Swift

  16. 16

    Change button's background alpha without changing the text alpha value in Android?

  17. 17

    Custom Delegate For UICollectionView Cell - Custom Button Not working

  18. 18

    Will UICollectionView change the cell's selected property to true before sending didSelectItemAtIndexPath delegate method?

  19. 19

    UICollectionView Cell with Image, change Background with click

  20. 20

    Change the image of a specific cell inside a UICollectionView

  21. 21

    UICollectionView: change the sizeForItemAtIndexPath from within custom cell

  22. 22

    Change UINavigationbar title according to UICollectionView Cell

  23. 23

    UICollectionView Cell with Image, change Background with click in Swift

  24. 24

    Change Cell Value if There is Overflow

  25. 25

    Cell value change with Month

  26. 26

    Change value of cell in Javascript

  27. 27

    Change value in a cell based on value in another cell

  28. 28

    Does changing alpha value change text?

  29. 29

    How to change alpha value along with scrolling

HotTag

Archive