iPhone SDK: UIScrollView does not scroll

后端 未结 2 936
没有蜡笔的小新
没有蜡笔的小新 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:52

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

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