I have a UIScrollView that works perfectly when I set its content size in the viewDidAppear method, just like this:
-(void)viewDidAppear:(BOOL)animated{
[scrollView setScrollEnabled:YES];
[scrollView setContentSize:CGSizeMake(320, 1500)];
}
But what I actually want to do is to calculate the height of my view after I've added all the different subviews in it, and that happens in a method "getAvis".
But when I add these two EXACT SAME LINES, just like this:
-(void)viewDidAppear:(BOOL)animated{
[self getAvis];
}
-(void)getAvis{
[scrollView setScrollEnabled:YES];
[scrollView setContentSize:CGSizeMake(320, 1500)];
}
It doesn't work anymore...What is the explanation? I really need to be able to set the content size in a separate method to be able to modify the content size whenever I want!
Thanks