views:

395

answers:

1

I have a custom UIView that is composed entirely of CALayers.

In the awakeFromNib method it creates and sets all the CALayers into their appropriate positions (CAGradientLayer, several CATextLayers, and a few custom CALayer subclasses). The custom UIView does not override the drawRect: method because there's no drawing done directly into the view (all of the drawing is done in the sublayers).

So I took this view and embedded it in a UIScrollView. The problem? No scroll bars appear and the view does not scroll. The view is clearly larger than the bounds of the scroll view, and instead of allowing me to scroll, it just cuts off at the scroll view bounds.

What could be wrong here?

+1  A: 

You have to set the scrollView's contentSize.

Ole Begemann
Thanks, that worked. I'm coming from Mac OS X programming where there is no such property to set, still getting used to the iPhone SDK.
macatomy