I have a UIScrollView
created in interface builder with a bunch of UITextView
and UIImageView
objects already added. I have it connected to an IBOutlet
, and under -(void)viewDidLoad
I set its content size to 1200x2000
. User interaction Enabled, Multitouch, Scrolling Enabled and shows vertical and horizontal scroll indicators are all set to YES
. When I launch the app in the iOS simulator, it doesn't scroll. What could possibly be the cause of this behavior?
viewDidLoad is to soon. You must wait until after the layout of the views has taken place. Try setting the contentSize in viewDidAppear.
Are you using autolayout? If so, check out the following answer (and forget 1.): UIScrollView doesn't use autolayout constraints.