分组UITableView Interface Builder示例/教程 [英] Grouped UITableView Interface Builder Examples/Tutorial

查看:123
本文介绍了分组UITableView Interface Builder示例/教程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在如何使用自定义UITableViewCells填充Grouped UITableView时遇到了很多麻烦。任何人都可以指向我如何做到这一点的教程吗?或者有没有人有一个示例,当使用自定义UITableViewCells创建一个Grouped UITableView时,cellForRowAtIndexPath方法会是什么样子?

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?

谢谢。

推荐答案

以下是一些指导原则:

分组UITableView中的每个组都是一个部分。然后,该方法:

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

这篇关于分组UITableView Interface Builder示例/教程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆