I have a UIScrollView on my UIViewController. I have the following options set:
- Shows Vertical Scrollers
- Scrolling Enabled
It DOES NOT scroll. When I set the following:
- Bounces Zoom
- Bounces
- Bounce Vertically
It scrolls but with bouncing… Is there something I am missing? Why is it that with scrolling enabled it doesn’t scroll??
[EDIT]
I was having some issues with it, but got it to work by setting the contentSize. My question however is this, I have a screen with all sorts of content, buttons, text, labels, etc. How is it possible to calculate (accurately) of the size of everything? Is there a way for it to automatically tell how much length the scrollview should grow?
I dont think there is an automatic way of resizing the contentSize to the subviews you have. If you are using Interface Builder and the content is not dynamic then setting the content size should be relatively easy. If not, your going to have to resize it manually.
You should be able to calculate the size by obtaining the frames of your object (
[myView frame]).You could write a method that checks the frames of all your subviews and resize the contentSize accordingly. Assuming you are placing your subviews in vertical order. taking the last Views frame’s y position + it’s height (
view.frame.origin.y + view.frame.size.heightcould be your contentViews height and so on…hope this helps.