我想在 UITableView
的每一行中添加图片。
当我使用 cell.image = [UIImage imgNamed:@"xxx.png"];
它跳出一条警告说 "image is deprecated"
。
虽然可行,但是否有任何替代方案不会产生警告?
最佳答案
是的,按照文档中的描述使用cell.imageView.image
:
image
The image to use as content for the cell. (Deprecated in iOS 3.0. Instead use the imageView property to get UIImageView object and then get or set the encapsulated image.)
关于objective-c - cell.image 已弃用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8446124/