First of all, I’d like to point out that I’m not asking for code. I’m just asking for the sort of things I’d need to do to get this to work, as right now I’ve absolutely no idea. Here’s what I want to do:
Similar to viewing someone’s photos in the Facebook app, I’d like to display an image (UIImageView) on the screen. When the user flicks it left (off the screen), the next photo in the album appears (I guess I could use some sort of array of images?). Flicking right moves to the previous photo in the album.
I’m sure I could figure out the loading images and array stuff, but the thought of moving an imageview off the screen with a flick animation and showing the next photo in the series is really daunting.
If you haven’t used the Facebook app, the effect I’m after is the same as switching pages on the home screen of the iphone. Once you drag the page so far, it snaps to the next page. Any help greatly appreciated.
You can do this very simply (as long as you aren’t implementing zoom as well) using UIScrollView with its
pagingEnabledproperty set toYES, and UIImageViews as subviews of the UIScrollView to display your images, of course.With
pagingEnabled == YES, the UIScrollView will snap its contentOffset to multiples of its bounds’ height and width.http://developer.apple.com/IPhone/library/documentation/UIKit/Reference/UIScrollView_Class/Reference/UIScrollView.html
http://developer.apple.com/IPhone/library/documentation/UIKit/Reference/UIScrollView_Class/Reference/UIScrollView.html#//apple_ref/occ/instp/UIScrollView/pagingEnabled