When I tried to use UIScrollView in iOS 7 and Xcode 5, it doesn't respond to vertical scrolling. I first drag and drop ScrollView from object library to storyboard and set its size as width = 320 and height = 1500, and then drag and drop three labels, and locate those labels at y = 300, 800, 1200. For labels whose y coordinate being equal to 800 and 1200, I first move scrollview to the upper to make those objects located at the corresponding y values. Then, I connect scrollview to implementation file as outlet, and in viewDidLoad
method, I write self.myScrollView.contentSize = CGSizeMake(320, 1500)
. And finally set back the size of scrollview at width = 320 and height = 568.
And then run the simulator, but it doesn't react to vertical scrolling. Then I deselected use autolayout
and run the simulator again, it's still not working at all.
So how can I fix the issue? Or can anyone inform me of any useful tutorials which teach about UIScrollView in iOS 7 and Xcode 5 (this is important, since every tutorial I've read is based on the prior version)?
I use Xcode 5.0.2.
Thanks.