1

I simply have a ViewController and added UIScrollView into that. Later on I created UIImageView which is larger than UIScrollView and inserted into the UIScrollView.

However when I run the simulator, UIScrollView does not scroll. I can bounce it but it does not simply leave it's current position within the UIImageView.

I also tried using [scrollView setContentSize:CGSizeMake(320, 640)]; within my viewDidLoad and it did not really work.

So how can I make the UIScrollView to actually scroll? I am using Xcode 5 and iOS 6.1

Sarp Kaya
  • 3,686
  • 21
  • 64
  • 103

1 Answers1

0

Set the contentSize in viewDidAppear rather than viewDidLoad. Make sure scrolling enabled is checked in the storyboard under the attributes inspector (select the scroll view and press the shield icon on the right top).

AdamG
  • 3,718
  • 2
  • 18
  • 28
  • Is user interaction enabled? – AdamG Oct 14 '13 at 18:18
  • Actually, try pressing the bounds button while selecting the scrollView and then clicking "reset to suggested bounds". That has fixed this problem for people in the past http://stackoverflow.com/questions/19227297/scrollview-start-scroll-only-second-time-that-the-view-appear/19252625#19252625 – AdamG Oct 14 '13 at 18:28
  • Where is bounds button? – Sarp Kaya Oct 18 '13 at 02:39
  • StoryBoard, lower right corner, middle tab icon, press "resolve autolayout issues" – AdamG Oct 18 '13 at 02:51
  • No, that did not fix too. I could not find any tutorial for Xcode 5 doing UIScrollView in storyboards. If you have some sort of blog or something could you make a short one and then include your project as well so that people can download and reference it? – Sarp Kaya Oct 18 '13 at 03:08