gpt4 book ai didi

objective-c - cell.image 已弃用

转载 作者:搜寻专家 更新时间:2023-10-30 19:54:15 26 4
gpt4 key购买 nike

我想在 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com