2

How to implement a table like in the image? Table with Row and column? Can any tell me the refrence for iphone

enter image description here

4

2 回答 2

1

列只是一种错觉。

这是通过继承 UITableViewCell 并将单元格设计为具有一个 UIImageView 和三个 UILabel 来完成的。

将 imageView 和标签分配给子类的属性,您可以通过这种方式配置它...

Object *object = [self.datasource objectAtIndexPath:indexPath];

cell.imageView.image = object.image;
cell.subCategoryLabel.text = object.subcategory;
cell.dateLabel.text = object.dateString;
cell.scoreLabel.text = [NSString stringWithFormat:@"%i", object.score];

或类似的东西。

然后标签的布局给人一种有列的错觉。

于 2012-11-21T08:41:52.520 回答
1

您需要根据您的要求创建自定义单元格。通过添加行和列来动态添加数据。在实现自定义单元格之前,请阅读此http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/tableview_iphone/TableViewCells/TableViewCells.html文档。

于 2012-11-21T08:42:23.697 回答