我正在制作一个带有表格视图的iPhone应用程序,并且我试图在桌子上的每个单元格旁放置一个不同的图标/图像。从cellForRowAtIndexPath获取单元格编号
我知道你在(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
的代码看起来像这样设置图像:
UIImage *image = [UIImage imageNamed:@"image.png"];
cell.imageView.image = image;
什么我想就是想不通,我怎么针对特定的细胞,所以它有一个独特的形象?像:
if (cell.number == 0) {
//Use a specific image
}
else if (cell.number == 1) {
//Use a different image
谢谢!
完美更容易,谢谢,我也会阅读苹果的文档。 – rottendevice 2011-03-20 01:11:59