-1

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

在此处输入图像描述

我怎样才能创建它?有任何想法吗

4

2 回答 2

2

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

于 2012-03-06T07:45:17.327 回答
2
- (id)initWithFrame:(CGRect)frame style:(UITableViewStyle)style

在这里,您可以指定UITableViewStyleGrouped样式以获取您看到的分组表视图。

表视图数据源

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView

在这里您应该返回表中的 no..of 部分(上图有 2 个部分..)

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

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

休息完成:

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

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

于 2012-03-06T07:47:11.770 回答