0

I created an UIScrollView inside a UIView and have put a couple labels and buttons in it.

The buttons and labels go on longer than the view frame, so I put this in the viewControllers viewDidLoad, like so:

-(void)viewDidLoad  {
    [[UIApplication sharedApplication] endIgnoringInteractionEvents];
    self.scrollView.contentSize = CGSizeMake(321, 600);
    self.scrollView.frame = self.view.frame;
}

I also set Bounce Vertically to true, so I can bounce the view lower, and it seems as if it's 'scrolling' but then as soon as I let go and it 'unbounces', it goes away.

Why won't my scroll view scroll and stay down?

neowinston
  • 7,584
  • 10
  • 52
  • 83
AndrewSB
  • 951
  • 3
  • 11
  • 25

2 Answers2

1

How are you adding the labels and buttons? If you are using Storyboard and Auto Layout, you will need to set constraints.

Check my answer here on how to do it.

Community
  • 1
  • 1
Enrico Susatyo
  • 19,372
  • 18
  • 95
  • 156
0

First of all, you should try adding this line:

[self.scrollView setScrollEnabled: YES];
Eliza Wilson
  • 1,031
  • 1
  • 13
  • 38