How to make a vertical scrolling view on iOS?

user1498477 picture user1498477 · Feb 25, 2013 · Viewed 55.7k times · Source

Can someone please guide me to a tutorial , on how to implement a vertical scrolling view on my iOS app?

I can't believe that the last 2 days , I can't find a single working example on just a vertical scrolling view. All the tutorials are about horizontal scrolling, zooming etc etc.

What I am looking for would be something like this tutorial http://www.edumobile.org/iphone/iphone-programming-tutorials/scrollview-example-in-iphone-2/, which shows how to make a uiscrollView and add objects to it, from the Builder and not programmatically. The only flaw I found was , that when trying to add a map down in the scrolling area, the map would appear up and not in the position I placed it. Maybe any ideas on that too?

Anything in mind?

Answer

Anil Varghese picture Anil Varghese · Feb 25, 2013

So you want to create a scroll view in xib.

  1. Add a scroll view to the nib file
  2. set its size to to whatever you want

    enter image description here

  3. Add your controls (Buttons,labels..)

    enter image description here

  4. Add it as a sub view of main view

    enter image description here

  5. Finally create a property of scroll view and in viewDidLoad set the content size of the scroll view

     self.scrollView.contentSize =CGSizeMake(320, 700);