I want to make the scrollRectToVisible:animated: work even when the contentSize is only set to 1 page size.
The reason: I have multiple pages in the UIScrollView but want to maintain the hard-drag provided by the UIScrollView when it is on the edges. If I set the contentSize accordingly to the number of pages I actually have, that hard-drag will be lost.
How I wish it worked:
- I keep track of which page to go to in "- (void)scrollViewDidScroll:(UIScrollView*)scrollView"
- I then call "[self.scrollView scrollRectToVisible:frame animated:YES];" in "- (void)scrollViewDidEndDragging:(UIScrollView*)scrollView willDecelerate:(BOOL)decelerate" if the next page number is different than the current one.
What happens: Nothing, the scrollRectToVisible:frame animated:YES does nothing because the contentSize is set to only 1 page width&height. I have tried to set the contentSize to be 2*height before calling the scrollRectToVisible method, and it sort of works, but scrolls back to the current page number.
So my question is, how can I force the UIScrollView to scroll to a certain position or at least emulate that behaviour?