add image to uitableview cell

前端 未结 7 1252

I have a tableview, how can I add image to the left of this cells?

相关标签:
7条回答
  • 2021-01-30 11:07
    cell.imageView.image = [UIImage imageNamed:@"image.png"];
    

    UPDATE: Like Steven Fisher said, this should only work for cells with style UITableViewCellStyleDefault which is the default style. For other styles, you'd need to add a UIImageView to the cell's contentView.

    0 讨论(0)
提交回复
热议问题