In my iphone app
i need to display header for the first section of the table view...
My requirement is to stick the header at the top of the table view (ie fixed at the bottom of the navigation bar) while scrolls down and
header Moves top top with scrolling while scroll to top side
just like face book page how the Post, Photo cheack-in location are below the Navgation bar. And when the user starts browsing the wall to top, this disappears... and pulling down it sticks at same place
I have tried with following code
it works for scroll to top
not working for scroll to down.
-(void)scrollViewDidScroll:(UIScrollView *)scrollView
{
CGFloat sectionHeaderHeight = 50;
if (scrollView.contentOffset.y<=sectionHeaderHeight&&scrollView.contentOffset.y>=0)
{
scrollView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0);
} else if (scrollView.contentOffset.y>=sectionHeaderHeight)
{
scrollView.contentInset = UIEdgeInsetsMake(-sectionHeaderHeight, 0, 0, 0);
}
}