我正在实现一个应用程序,它有 2 个图像,我需要在同一个 tableviewcell 上显示。
但是,由于应用程序的设置方式,我无法将 tableviewcell 子类化。所以我想以编程方式创建一个 ImageView ,然后添加到 cell.contentview,但结果是错误的。任何帮助将不胜感激。
最佳答案
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];
关于iphone - 第二个图像将如何查看 tableview 单元格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10506321/