I have a table view and I add a sub view directly to the table view with addSubview:. I show this view in position CGRectMake(0.0f, -30.0f, tableView.frame.size.width, 30.0f)(therefore it is displayed above the scrollable area of the table when the user scrolls slightly outside the scroll area). Then I do this:
- (void) scrollViewDidScroll:(UIScrollView *)scrollView {
if(scrollView.contentInset.top + scrollView.contentOffset.y < -30.0f) {
[scrollView setContentOffset:CGPointMake(1.0f, -30.0f)-scrollView.contentInset.top animated:NO];
}
}
Thus, when the user scrolls up and into the negative space in the table view, when they are released they can still see what I put in y = -30 so that the table does not “snap back” to 0.
Everything works the way I want. However, when the table is contentOffsetset to a negative value of y, such as [scrollView setContentOffset:CGPointMake(1.0f, -30.0f)-scrollView.contentInset.top animated:NO], then the strokes are NOT recognized both in the cells of my table and in the view that I inserted directly into the table. I am wondering how I can set contentOffset to that value, and still have child views of my tableView, as well as cells, register strokes.
source
share