3

I'm currently looking for a solution to mimic NSOutlineView with UIKit. The idea is to create a UITableView that displays a hierarchy similar to the list view in a typical Finder window. In other words, items can be expanded or not, and each item can contain children or not.

Since the hierarchy can be several levels deep, using only sections is not an option. The tricky part is to have a controller that efficiently manages the data source of the table view and knows what items are expanded and how many rows to collapse or expand when the user interacts with the table view.

I'm not asking for a ready-made solution, but I would appreciate pointers or advice to get this working in an efficient way.

4

1 回答 1

1

关于效率,我不能给出任何提示。但是UITableViewCells 有一些对级别的内置支持。您可以为每个单元格设置缩进量和级别。所以缩进部分很简单。但是扩张难度很大。

我为我的一个应用程序做了一个有点无效的实现,但我可以很确定只有几百个项目。所以效率足够高。

于 2011-05-20T20:26:00.780 回答