I followed this post to make my section header animate out of view when the tableview is scrolled. However, when scrolling back to the top, the header does not come back into view. Ever. Given that I followed the solution exactly (and I'm not setting the contentInset anywhere else), I'm quite perplexed. Can anyone point me in the right direction? Here is my code:
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGPoint p = scrollView.contentOffset;
CGFloat height = [self tableView:self.agendaDetailTable heightForHeaderInSection:0];
if (p.y <= height && p.y > 0) {
self.agendaDetailTable.contentInset = UIEdgeInsetsMake(-p.y, 0, 0, 0);
} else if (p.y >= height) {
self.agendaDetailTable.contentInset = UIEdgeInsetsMake(-height, 0, 0, 0);
}
}