I have created an ebook app with a single scroll view and a single image view. When the user clicks the Next button, it displays the next image in the image view. You can scroll the image, then when you click Next, the next image's scroll is reset to (0,0). I do this by using the line: scrollView.contentOffset = CGPointMake(0, 0);
It works well, but with a little bug I can't seem to understand: If I wait for the scrolling to stop, then click Next, it works: the new image is reset to 0,0. But if I don't wait, then click next, the new image's position is the same as the previous one and the scrolling continues with the new image. Do you know a way around this?
seem that changing contentOffset during a scroll make some problems, maybe you can try to change the image on scrollViewDidEndDecelerating: so that when you change it the view is stopped.....just an idea, i don't know if can feet your needs.
However why you not use a uiscrollview paged with all the images? i think is more appropriate for a ebook....
ps: have you tried with
[yourScrollView setContentOffset:CGMakePoint(0,0) animated:NO];
however using the other approach give a better user experience that clicking a button (he can slide to change page)....
I didn't know. Do you do this by stacking images of the same size and at the same position in the scrollview? I don't even know the code I should use for this. And what about memory? For this project, I have tried to load as less images at once as possible, which is why a single uiImage seemed convenient. Using a Back and Forward button seemed logical to me too. As a reader, I usually have less trouble clicking a Back and Forward button with my thumbs, than sliding a page. That said, I will definitely try this, at least as a test.
I didn't know. Do you do this by stacking images of the same size and at the same position in the scrollview? I don't even know the code I should use for this. And what about memory? For this project, I have tried to load as less images at once as possible, which is why a single uiImage seemed convenient. Using a Back and Forward button seemed logical to me too. As a reader, I usually have less trouble clicking a Back and Forward button with my thumbs, than sliding a page. That said, I will definitely try this, at least as a test.
basically you can see this example by apple: ScrollViewSuite