Why won't UIScrollView scroll fully after adding objects? Using storyboard, ARC, and Xcode 4.5.2

前端 未结 3 1731
一生所求
一生所求 2020-12-29 14:52

So, I know there are similar questions to mine, but maybe not exact (so please don\'t mark me down -- just warn me or something). I have searched for days for the solution t

3条回答
  •  生来不讨喜
    2020-12-29 15:14

    After days of research, it's funny I actually found the solution just minutes after posting this question! So, for my situation I simply had to add this bit of code, and it worked:

    - (void)viewDidLayoutSubviews
    {
        [super viewDidLayoutSubviews];
        [self.scrollView setContentSize:CGSizeMake(320, 808)];
    }
    

    It seems to be working perfectly now. Please, anyone, let me know if this is a poor way of doing it, because I'm new to this and I would love any help. Otherwise, I'll leave it and hope this can help other people! Thanks!

提交回复
热议问题