iPhone SDK: UIScrollView does not scroll

后端 未结 2 1809
生来不讨喜
生来不讨喜 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:02

    your scrollview frame should be smaller than contentSize,so only you can make scrollview scrollable.

    0 讨论(0)
  • 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)];
    
    0 讨论(0)
提交回复
热议问题