【发布时间】:2011-09-09 03:27:54
【问题描述】:
我有以下代码,它将在 UItable 视图中显示结果以及图像。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
//create a cell
UITableViewCell *cell = [[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:@"cell"];
// fill it with contnets
NSDictionary *exercise = [exercises objectAtIndex:indexPath.row];
cell.textLabel.text = [exercise valueForKey:@"player"];
UIImage *image = [UIImage imageNamed:@"iphone.gif"];
cell.imageView.image = image;
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
// return it
return cell;
}
是否有一个选项,我可以为所有单元格显示一个图像,例如。左侧有 1 张图像,右侧有 3 行。我是一个新的投标人,并且仍然掌握 iPhone 编码。请建议我如何做到这一点。谢谢。
【问题讨论】:
-
看看这个......stackoverflow.com/q/7346902/919049
-
您是要在每个单元格中添加一张图片还是在三个单元格中添加一张图片?
标签: iphone uitableview xcode4 uiimage