UITableViewCell Set Selected Image

后端 未结 5 1194
误落风尘
误落风尘 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

    Try this ...

        UIImage *bgImage = [UIImage imageNamed:@"icon_call.png"];
        UIImageView *bgImageView = [[UIImageView alloc] initWithImage:bgImage];
    
        [bgImageView setFrame:CGRectMake(280, 2, 30, 38)];
    
    //Finally give this imageView to the cell
    
         [cell.contentView addSubview:bgImageView];
    

    Hope it will solve your problem !

提交回复
热议问题