I\'m facing with a simple but tedious problem. What I\'m trying to do is make an UITableView to page like an UIScrollView but enabling paging doesn\'t help me so much because I
Simple but efficient:
- (void)scrollViewDidEndDecelerating:(UITableView *)tableView {
int tomove = ((int)tableView.contentOffset.y%(int)tableView.rowHeight);
if(tomove < tableView.rowHeight/2) [tableView setContentOffset:CGPointMake(0, tableView.contentOffset.y-tomove) animated:YES];
else [tableView setContentOffset:CGPointMake(0, tableView.contentOffset.y+(tableView.rowHeight-tomove)) animated:YES];
}
- (void)scrollViewDidEndDragging:(UITableView *)scrollView willDecelerate:(BOOL)decelerate {
if(decelerate) return;
[self scrollViewDidEndDecelerating:scrollView];
}