Changing Image on selected state of UITablView cell

前端 未结 3 1617
遇见更好的自我
遇见更好的自我 2020-12-18 13:50

I have a created a custom cell and added one label and Image, I have 4 rows in my table each row has a different image and each row opens a different view controller, so, no

3条回答
  •  遥遥无期
    2020-12-18 14:28

    Try to do following when creating your cell or in tableView:willDisplayCell:forRowAtIndexPath: method:

    cell.imageView.image = [UIImage imageNamed:@"abc.png"];
    cell.imageView.highlightedImage = [UIImage imageNamed:@"abc.png"];
    

    It will work for your icon property too if it is UIImageView

提交回复
热议问题