iPhone SDK: UIScrollView does not scroll

后端 未结 2 937
没有蜡笔的小新
没有蜡笔的小新 2021-02-15 00:45

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 00:53

    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)];
    

提交回复
热议问题