在Instagram应用程序中的表视图

时间:2012-03-06 07:37:45

标签: ios xcode uitableview tableview instagram

在Instagram应用中,当您添加新照片时,您可以看到此表:

enter image description here

我该如何创建它?任何想法

2 个答案:

答案 0 :(得分:2)

@Eugene是一个group table,有多个部分。如果您不知道如何创建组表,那么请查看本教程 - http://www.mobisoftinfotech.com/blog/iphone/iphone-uitableview-tutorial-grouped-table/

答案 1 :(得分:2)

- (id)initWithFrame:(CGRect)frame style:(UITableViewStyle)style

在这里,您可以指定UITableViewStyleGrouped作为获取您看到的分组tableview的样式..

表格视图数据源

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView

这里你应该返回表格中的no..of部分(上面的图片有2个部分..)

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section

以上方法用于指定该部分的标题..在上图中(第一部分没有标题...返回“分享”第二部分)

休息在:

完成
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

在这里,您可以为单元格提供自定义文本...更改其字体...在单元格中显示附件...添加图像到单元格..