将图像添加到表格单元格(iOS)

前端之家收集整理的这篇文章主要介绍了将图像添加到表格单元格(iOS)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试做类似于Twitter或Facebook的事情.

解决方法@H_502_4@
  1. - (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
  2. {
  3. static NSString* CellIdentifier = @"Cell";
  4.  
  5. UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  6. if (cell == nil)
  7. cell = [[[UITableViewCell alloc] UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
  8.  
  9. cell.textLabel.text = @"I'm a UITableViewCell!";
  10. cell.imageView.image = [UIImage imageNamed:@"MyReallyCoolImage.png"];
  11.  
  12. return cell;
  13. }

Thomas Moore

adding images to UItableView

猜你在找的iOS相关文章