I set the size of the UIScrollView in viewDidLoad: but when I try to get its height, I get 0 in the console
here is my code:
- (void)viewDidLoad {
[scrollView setContentSize:CGSizeMake(320,500)];
NSLog(@"scrollView: %@", scrollView);
NSLog(@"scrollView.contentSize.height: %i", scrollView.contentSize.height);
[super viewDidLoad];
}
and in the console log I get
scrollView: <UIScrollView: 0x4974110; frame = (0 0; 320 367); clipsToBounds = YES; autoresize = RM+TM; layer = <CALayer: 0x4974010>>
scrollView.contentSize.height: 0
Shouldn't scrollView.contentSize.height 367 be returned? In a related note, I pointed out that the height should be 500 through [scrollView setContentSize:], but this does not seem to apply?
source
share