作为Xcode初学者,我想在我的应用程序的表格单元格中显示缩略图。现在,我有了解析JSON数据并将其发布到单元格的标题和副标题中的代码。如何在xCode中将缩略图图像显示到表单元格?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MainCell"];
if(cell == nil){
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"MainCell"];
}
cell.textLabel.text = [[news objectAtIndex:indexPath.row] objectForKey:@"receta"];
cell.detailTextLabel.text = [[news objectAtIndex:indexPath.row] objectForKey:@"koha"];
return cell;
}
如何显示单元格右侧的缩略图?
谢谢。
创建一个自定义单元,您可以使用您自己的布局。在Google上搜索自定义UITableViewCells。 – Popeye 2013-04-11 14:58:14
Popeye,你会介意帮助我吗?我搜索了,但我没有找到对我有用的东西,因为我对Xcode有一些了解,这是我第三次今天打开它。 – 2013-04-11 15:00:27
我会推荐一些教程比。这里是一个很好的教程http://blog.spritebandits.com/2012/03/13/creating-custom-uitableviewcells-from-xibs-step-by-step-tutorial/ – Popeye 2013-04-11 15:05:11