2
votes

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?

1
honestly I don't know, but welcome anyway ;-)endo.anaconda
can you add some code and some screen shot?rishi
Thanks! Well the sample code would be easy - just set up a grouped table view with a header. Observe the property contentOffset on the tableview and position the header origin y at the contentOffset y. This will make it "stay on top".David
Why don't you use section headers which have this behavior by default? Don't try to redesign the table! Table header is something that should be always visible!Sulthan

1 Answers

-2
votes

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.