add image to uitableview cell

前端 未结 7 1265

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

7条回答
  •  暖寄归人
    2021-01-30 10:57

    For my fellow Swift users, here is the code you will need:

    let imageName = "un-child-rights.jpg"
    let image = UIImage(named: imageName)
    cell.imageView!.image = image
    

提交回复
热议问题