Grouped UITableView Interface Builder Examples/Tut

2019-08-16 06:19发布

问题:

I'm having an immense amount of trouble figuring out how to populate a Grouped UITableView with custom UITableViewCells. Could anyone point me towards a tutorial on how one might do this? Or does anyone have an example of what a cellForRowAtIndexPath method would look like when creating a Grouped UITableView with custom UITableViewCells?

Thanks.

回答1:

Here are some guidelines:

Each of your group in grouped UITableView is a section. Then the method:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
   if (indexPath.section == 0) {
      // Here is first group
      if (indexPath.row == 0) {
         // Here is first row in a first group 
      }
   }
}

I hope that this makes sense for you



回答2:

I think you can browse this TableViewSuite sample codes.