OGeek|极客世界-中国程序员成长平台

标题: ios - 将图像分配给表格单元格中的 uiimageview [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 10:01
标题: ios - 将图像分配给表格单元格中的 uiimageview

我在自定义表格单元格中有一个 ImageView ,我需要从表格 View 委托(delegate)中为其分配一张图片

  cell.imageViewLeft = [[UIImageView alloc] initWithImage:[UIImage imageNamed:fxObject.thumbnailName]];
    NSLog(@"%@, %@", [UIImage imageNamed:fxObject.thumbnailName],  cell.imageViewLeft.image);

日志给了我:

, (null)



Best Answer-推荐答案


确保您的 IBOutlets 连接正确。

另外,确保你@synthesize 你的imageViewLeft!

cell.imageViewLeft.image = [UIImage imageNamed:fxObject.thumbnailName];

关于ios - 将图像分配给表格单元格中的 uiimageview,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15752346/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4