iPhone UITableView嵌套部分 [英] iPhone UITableView Nested Sections

查看:142
本文介绍了iPhone UITableView嵌套部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于 acani iPhone应用,我想在 UITableView中显示群组(基于兴趣) 。我想按分类方式组织这些小组,例如:

For the acani iPhone app, I'd like display groups (based on interests) in a UITableView. I'd like to organize the groups taxonomically, e.g.:


  • 体育

    • 蝙蝠-and-ball

      • 棒球

      • 垒球

      • Cricket


      • 曲棍球

      • 冰上曲棍球

      • Roller Hockey


      • 电气工程

      • 生化工程

      我应如何在 UITableView 上安排这个?

      How should I arrange this on a UITableView?

      我在想应该有一个根 UITableView ,它将包含Sports&工程,以及细胞Bat-and-ball&曲棍球将在体育部分,和电池工程&生化工程将在工程部分下。

      I'm thinking that there should be a root UITableView that will have the sections Sports & Engineering, and the cells Bat-and-ball & Hockey will be under the Sports section, and the cells Electrical Engineering & Biochemical Engineering will be under the Engineering section.

      然后蝙蝠和球应该有自己的 UITableView ,应该有细胞棒球,垒球和板球。

      Then Bat-and-ball should have its own UITableView, which should have cells Baseball, Softball, and Cricket.

      这听起来像是一种安排用户界面的好方法吗?

      Does this sound like a good way to arrange the UI?

      你有这样的用户界面的Xcode示例代码的示例代码或链接吗?必须有一个像这样的Xcode示例项目。也许是元素周期表项目或Core Data Books?

      Do you have any sample code or links to Xcode sample code for a UI like this? There's gotta be an Xcode sample project that does something like this. Perhaps the periodic table of elements project or Core Data Books?

      谢谢!

      Matt

      推荐答案

      你懂了。 UITableView 实际上并不是为了显示层次结构的两个以上级别而设计的。如果你想要显示两个以上的级别,大多数(所有?)iOS应用程序中使用的向下钻取方法,其中点击一行在导航上显示另一个 UITableView 叠加。 (正如你所说。)

      You got it. A UITableView really isn't designed to show more than two levels of a hierarchy, as sections and rows. If you want to show more than two levels, a "drill-down" approach used in most (all?) iOS apps, where tapping a row presents another UITableView on the navigation stack. (As you say.)

      有很多Apple示例代码项目都使用这种设计模式。

      There are lots of Apple sample code projects that use this design pattern.

      编辑:刚刚选中并 DrillDownSave 就是一个很好的例子,以及 SimpleDrillDown

      just checked and DrillDownSave is a good example, as is SimpleDrillDown.

      这篇关于iPhone UITableView嵌套部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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