【发布时间】:2009-10-12 15:10:48
【问题描述】:
我这样做是为了将图像加载到 tableview 单元格中:
UIImage *image = [UIImage imageNamed:@"myimage.png"];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
imageView.frame = CGRectMake( 0, 0, cell.frame.size.width, cell.frame.size.height );
imageView.contentMode = UIViewContentModeScaleToFill;
[cell addSubview:imageView];
[imageView release];
return cell;
但是,没有图像显示为单元格的背景。这是在一个新的导航应用程序中。当您使用自定义单元格时,上面看起来就像 Interface Builder 中的步骤。该图像位于应用程序包中。我做错了什么?
【问题讨论】:
标签: iphone cocoa-touch uitableview uiimageview