iPhone SDK: UIScrollView does not scroll

后端 未结 2 1808
生来不讨喜
生来不讨喜 2021-02-15 00:24

I just can\'t get my scroll view to actually scroll.. Everything displays fine except it just won\'t scroll..... Here\'s my code:

- (void)viewDidLoad {
    [supe         


        
2条回答
  •  北荒
    北荒 (楼主)
    2021-02-15 01:04

    The contentSize must be larger than the scrollview's frame for there to be anything to scroll. :)

    In this case, they're both (320, 600) so change your scrollView's init to

    UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
    

提交回复
热议问题