0

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

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

4

1 回答 1

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];
于 2012-05-08T20:56:19.597 回答