Danny
Danny

Reputation: 3700

How Do I Create A Simple Scroll View That Scrolls Through Static Images?

Perhaps it's something with Xcode 4.5+ or iOS 6 that makes my research fruitless so far, but...

So what gives? Is it possible to create a simple, image-filled view that allows scrolling? Say... something as easy as this basic project I set up on github -- but working?

Upvotes: 1

Views: 396

Answers (1)

Lithu T.V
Lithu T.V

Reputation: 20021

  1. Create and initialize a UIScrollView
  2. Add it as subview to the view of viewcontroller
  3. Make an array of image names
  4. In a loop create UIImageView and add the images and add imageviews into scrollview considering the width of images, set the frame of imageviews
  5. Number of images is known and the width it consumes can be calulated from the loop itself use it to set the contentSize of the scrollview

Upvotes: 1

Related Questions