Grouped UITableView Interface Builder Examples/Tutorial

◇◆丶佛笑我妖孽 提交于 2019-12-12 01:57:54

问题


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.



来源:https://stackoverflow.com/questions/3748544/grouped-uitableview-interface-builder-examples-tutorial

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!