简体   繁体   中英

UITableView section appears over tableHeaderView

I have a UITableView instance to which I have added a header using the tableHeaderView property. I observe for changes in the contentOffset property to be able to move the header in the opposite direction, allowing it to stay at the top of the table when scrolled at least a certain amount. I want to have it in this way because of two reasons. First, I want the scroll bar to cover the header. Secondly, I'm moving the header with the scrolled content for about 100 points, then I'm keeping it at the top.

Everything is fine except for one detail. The table view sections appear above the tableHeaderView . How do I get them to appear below?

EDIT: How do I get the sections of a UITableView to appear below the assigned tableHeaderView view in the view stack?

This is not a solution to the problem, but this way worked for me:

I simply pushed the titles into the array feeding the table view cells as strings and added them as cells with different cell identifiers than the cells i used otherwise.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM