I can't think of a cleaner solution than doing the math on the fly. If the desired page length is 100px than "slide" the UIImage so that it stays relative to the actual page. So something akin to:
CGFloat pageWidth = 100;
int numPages = ceilf(myImageView.bounds.size.width / pageWidth);
scrollView.contentSize = CGSizeMake(numPages * scrollView.bounds.size.width,
scrollView.bounds.size.height);
Then subclass the scroll view's layoutSubviews
method:
- (void)layoutSubviews {
int numPages = ceilf(myImageView.bounds.size.width / pageWidth);
CGRect visibleBounds = [self bounds];
CGFloat start = visibleBounds.origin.x;
CGFloat offset = start / pageWidth;
myImageView.frame = CGRectMake(offset, myImageView.frame.origin.y,
myImageView.frame.size.width,
myImageView.frame.size.height);
}
I haven't tested this at all but hopefully it gets you on a working track. What this should be doing is moving the image whenever you scroll so that it looks like each "page" only moves the image 100px.