如何使滚动VIew向所有方向滚动?

时间:2012-06-10 08:43:45

标签: iphone

我的问题是这样的: -

{       someview = [[someview1 alloc]initWithFrame:CGRectMake(0, 0, 1024, 1024)) resolution:CGSizeMake(768, 960))];

    scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0,768,960)];
            scrollView.contentSize = CGSizeMake(1024,1024);


     scrollView.bouncesZoom = YES;
        scrollView.pagingEnabled = YES;
        scrollView.backgroundColor = [UIColor blackColor];
        scrollView.showsHorizontalScrollIndicator = YES;
        scrollView.showsVerticalScrollIndicator = YES;  
        scrollView.userInteractionEnabled = YES;
        CGRect Frame=rdcview.bounds;
        scrollView.minimumZoomScale = 1.0; 
        scrollView.maximumZoomScale = 2.0;
       [scrollView setDelegate:self];

        [scrollView addSubview:someview1];
        [self.view addSubview:scrollView];
}

毕竟这是我旋转我的设备,但视图在所有方向都不可滚动,PLZ帮我找到解决方案。

注意: - 它会滚动但不会粘住它们,当我移开手指时它会回到上一个
职位。

1 个答案:

答案 0 :(得分:1)

我认为你有一个错字。

变化:

[scrollView addSubview:someview1];

为:

[scrollView addSubview:someview];