How to disconnect UITableView from vertical scrolling?

I am using EGORefreshTableHeader in combination with a static cell (defined in nib) in a UITableView.

I would like to scroll the table down to call EGORefreshTableHeader , and thus update the data in the static cell. BUT, since the static cell has a size that fits perfectly in the window, I want people to not be able to scroll up.

Is there any way to do this?

+4
source share
1 answer

Try the following:

 CGFloat a; -(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { a = scrollView.contentOffset.y; } -(void)scrollViewDidScroll:(UIScrollView *)scrollView { if (scrollView.contentOffset.y > a) { [scrollView setScrollEnabled:NO]; [scrollView setContentOffset:CGPointMake(0, a)]; } [scrollView setScrollEnabled:YES]; } 
+9
source

All Articles