sebi
sebi

Reputation: 837

How to make simple horizontal photo gallery with iOS5

I would like to make a VERY simple photo gallery that displays 1 image at a time, that you swipe left or right to see the image. This gallery will have 4-6 images max. It doesn't need any fancy effects or zooming etc.

I tried rotating a scrollView 90 degrees with images, but the scroll speed is too fast, if you swipe left you should only move 1 image at a time, and if you're in mid swipe then let go, the scroll view should auto scroll to the nearest full image/cell. Maybe if someone could help me with just those to things that would be nice. I don't want to use three20, as it's very complicated and has a lot of things I don't need.

Upvotes: 2

Views: 503

Answers (1)

DrummerB
DrummerB

Reputation: 40201

Don't rotate the scroll view. Just set the content size to be wider then the screen. To make it stop at every image, you have to use paging. Set pagingEnabled to YES and the scroll view stops on multiples of the scroll view’s bounds when the user scrolls.

Upvotes: 1

Related Questions