第二个图像如何查看tableview单元格?

时间:2012-05-08 20:53:10

标签: iphone ios facebook-graph-api uitableview uiimageview

我正在实现一个应用程序,它有2个图像,我需要在同一个tableviewcell上显示。

然而,由于应用程序的设置方式,我不能将tableviewcell子类化为什么。所以我想以编程方式创建一个图像视图,然后添加到cell.contentview,但它只是出错了。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:5)

UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
[imageView setFrame:CGRectMake(x,y,width,height)]; //note this is in the cell coordinate system
[cell.contentView addSubview:imageView];