I want to show view on the top of the tableview when scroll down and hide when scroll up.
Here is my effort
tblView.tableHeaderView=headerToolbar;
[tblView setContentOffset:CGPointMake(0, 44) animated:YES];
When User Scroll
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset {
CGPoint targetPoint = *targetContentOffset;
CGPoint currentPoint = scrollView.contentOffset;
if (targetPoint.y > currentPoint.y) {
[tblView setContentOffset:CGPointMake(0, 0) animated:NO];
}
else {
[tblView setContentOffset:CGPointMake(0, 44) animated:NO];
}
}
But its not working when scroll up.