iOS 7. Keep UITableView section header from sticking on top

本秂侑毒 提交于 2019-12-11 14:24:19

问题


I'm designing a menu with categories and subcategories: when the user clicks a category, it should unfold to show its subcategories in an accordion style.

My first approach (and the easiest, I guess), is setting a table section per category: section headers would contain the category, and the inner cells would be subcategories, but the default behavior of the section headers staying at the top doesn't fit too well with the design of my interface.

My questions:

- Is there any iOS7 feature to prevent this behavior so that section headers keep moving just as a normal cell?

- Am I missing some UITableView feature conceived for accordion styled menus?


I'm aware of this old thread.-

Change Default Scrolling Behavior of UITableView Section Header

which solution is based on using scrollViewDidScroll, just wondering if there's any new feature to perform the task in a 'less manually' way.


回答1:


If you use UITableViewStyleGrouped then the section headers will scroll down with the cells.



来源:https://stackoverflow.com/questions/24014775/ios-7-keep-uitableview-section-header-from-sticking-on-top

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