Alex Stone
Alex Stone

Reputation: 47364

iPhone iOS how to present a number of UIImages in sequence with gestures for navigation?

I'm trying to add documentation to my app to do so, I took a bunch of screenshots and added labels and arrows to them. Now I have a bunch of full screen 320x480 PNG files that I need to present to the user.

I really like the carousel example as outlined here, but it does not seem to work with the full screen images right out of the box: iPhone carousel controller

What else can I use that I can just plug into my project to allow the user to move through multiple images back and forth with the side swiping gestures?

Upvotes: 0

Views: 639

Answers (2)

crgt
crgt

Reputation: 1482

You could also have a look at UIGestureRecognizer, in particular UISwipeGestureRecognizer. Documentation is here: http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIGestureRecognizer_Class/Reference/Reference.html#//apple_ref/occ/cl/UIGestureRecognizer

So, you might add a UISwipeGestureRecognizer like so:

UISwipeGestureRecognizer *gestureRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(myAction)];

You could then change (or animate) your image in the myAction method which would get called upon the swipe.

Upvotes: 1

louielouie
louielouie

Reputation: 14941

You want to do a UIScrollView that does paging, with each page probably being a UIImageView that contains your PNG.

You can take a look at a solution that is kind of like how Mobile Safari allows you to switch through tabs: UIScrollView horizontal paging like Mobile Safari tabs

If you want to do full-screen images, you can also look at the PhotoScroller example from Apple at http://developer.apple.com/library/ios/#samplecode/PhotoScroller/Introduction/Intro.html There was a great WWDC 2010 video that goes along with this that you should watch as well.

Finally, you should consider creating 640x960 PNG files as well, since that would look best on Retina screens.

Upvotes: 2

Related Questions