呈现嵌套树的正确方法
Proper way to present nested tree
我有这样的树:
Root
-CountryA
-RegionA
-producerA
-RegionB
-ProducerB
-ProducerC
-RegionC
-ProducerD
-CountryB
.
.
Several countries with the same pattern
而且我必须联系一位制作人。
起初我对每个级别都使用了 UITableViewController
,但后来我发现这不是最好的方法。现在我正在考虑一个 UTableViewController
带有可扩展单元格。
你是怎么处理类似问题的?
我建议在所选单元格下插入新单元格。
你有
-CountryA
-CountryB
-CountryC
用户选择国家 B。然后,在 tableView:didSelectRowAtIndexPath 中:使用方法 insertRowsAtIndexPaths:withRowAnimation:使用索引路径部分 0 和行 2-(CountryB 中的区域数)。
我有这样的树:
Root
-CountryA
-RegionA
-producerA
-RegionB
-ProducerB
-ProducerC
-RegionC
-ProducerD
-CountryB
.
.
Several countries with the same pattern
而且我必须联系一位制作人。
起初我对每个级别都使用了 UITableViewController
,但后来我发现这不是最好的方法。现在我正在考虑一个 UTableViewController
带有可扩展单元格。
你是怎么处理类似问题的?
我建议在所选单元格下插入新单元格。
你有
-CountryA
-CountryB
-CountryC
用户选择国家 B。然后,在 tableView:didSelectRowAtIndexPath 中:使用方法 insertRowsAtIndexPaths:withRowAnimation:使用索引路径部分 0 和行 2-(CountryB 中的区域数)。