在 Instagram 应用程序中,当您添加新照片时,您可以看到此表:
我怎样才能创建它?有任何想法吗
@Eugene 它group table
具有多个部分。如果您不知道如何创建组表,请查看本教程 - http://www.mobisoftinfotech.com/blog/iphone/iphone-uitableview-tutorial-grouped-table/
- (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
在这里,您可以为单元格提供自定义文本...更改其字体...在单元格中显示附件..将图像添加到单元格..