views:

17

answers:

1

I am adding a bunch of boxes into a UIView inside of a UIScrollerView. The content of the UIView goes beyond the bottom of the device's screen and should cause the whole scene to scroll.

However, this isn't happening. The content gets added but the scene will not scroll. I assume it has to do with UIKit not automatically resizing the UIView container to match the overflowed content (I can understand why), so I tried setting the new bounds rectangle with [container setBounds: CGRectMake(0, 90, 768, 230*20)], with the 20 being the number of boxes (the height of each is 230). When I do this, nothing appears at all...

Anyone know why the content doesn't reappear or does anyone have another solution for making the UIScrollView scroll?

+4  A: 

You should set the contentSize of scrollview, to match your UIView's size.

Please see

http://developer.apple.com/library/ios/documentation/UIKit/Reference/UIScrollView_Class/Reference/UIScrollView.html#//apple_ref/occ/instp/UIScrollView/contentSize

Deniz Mert Edincik
That was it. Thanks!
Andrew M