Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't scroll in UIScrollView as soon as UILabel / other subview added in Storyboard

I encountered the following problem: as soon as I add e.g. a UILabel to my UIScrollView - using the storyboard - the scroll view stops "working" (with that I mean you cannot scroll at all). However adding a subview programmatically the scroll view works fine but since I prefer designing my apps visually with storyboard I would like to solve this mysterious error.

Does anyone knows why this error is occurring? Thanks in advance :)

PS: I do set the contentSize of my scrollView, so this cannot be the problem!

like image 258
pasql Avatar asked Sep 17 '12 12:09

pasql


1 Answers

Move the code in the viewDidAppear function like this

-(void)viewDidAppear:(BOOL)animated{

[super viewDidAppear:animated];
self.scrollView.contentSize = CGSizeMake(500.f, 500.f);

}

like image 111
MUH Mobile Inc. Avatar answered Oct 15 '22 18:10

MUH Mobile Inc.