How to start with particular Image using the iPhone WWDC 2010 - 104 PhotoScroller
-
28-09-2019 - |
문제
I am going through the Sample code of iPhone WWDC 2010 - 104 PhotoScroller App.
It's working great with my project related images (PDF Page Images)
Now I want to start the app from a custom image no - Say 5. And it should show 6th image on next swipe and 4th on previous swipe.
Can anyone help in this Regard ?
해결책
I think you should try modifying the contentOffset of the UIScrollView.
Depending on the width frame you should set it to something like :
imagePos * scrollView.frame.width
where imagePos begin to 0 and end to (nbrImage - 1)
Good Luck ;-)
다른 팁
I made it this way. I have UIScrollView *contentView and in init I calculate frame for photo I want to display and just scroll contentView to that rect. tilePages will do everything else for you
[contentView scrollRectToVisible:[self frameForPageAtIndex:_index] animated:NO];