How can I add more floating sub-sections to a UITableView?

こ雲淡風輕ζ 提交于 2019-12-11 07:09:00

问题


My goal is to represent a tree hierarchy much like this:

Building
  Zone
    Floor
      Room

... using a table view.

To accomplish this the design asks for each tree level to be embedded as its own Section.

A .plain UITableView is limited as it supports only one floating Section. Further research led me to create my own custom SectionView, and placed it just below the navbar.

I've also strategized with marking certain rows as my fake sections and playing with scrollViewDidScroll also seems like the correct direction.

But am now perplexed in how to accomplish tracking the location of certain section cells, stacking them to float accordingly and animate scrolling correctly through each level section overlap.

To clarify, in my example below, the scrolling should stack like this:

Building <section>
Zone(s)  <sub-section>
Floor(s) <sub-section>
 Room(s) <rows>

Other tree formats also need to be supported:

Building <section>
  Zone 1 <section>
    Room <rows>
  Zone 2 <section>
    Room <rows> 


Building <section>
    Room <rows>

So the tree structure isn't fixed.

来源:https://stackoverflow.com/questions/49658938/how-can-i-add-more-floating-sub-sections-to-a-uitableview

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