UITableViewCell Set Selected Image

后端 未结 5 1192
误落风尘
误落风尘 2021-02-07 08:26

trying to figure out how to set the selected image for for a tableViewCell.

The old way of writing this was cell.selectedImage but that has bee

5条回答
  •  孤街浪徒
    2021-02-07 08:47

    Use this one!:

    selectionBackground = [UIImage imageNamed:@"background.png"];
    cell.selectedBackgroundView =[[UIImageView alloc] init];
    ((UIImageView *)cell.selectedBackgroundView).image = selectionBackground;
    

提交回复
热议问题