Iphone 如何使滚动视图向所有方向滚动?
我的问题是这样的:-Iphone 如何使滚动视图向所有方向滚动?,iphone,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 = CGSize
{ 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];
}
在所有这些之后,我旋转我的设备,但是视图不能在所有方向上滚动,请帮助我找到解决方案
注意:它会滚动,但不会粘住手指,当我移开手指时,它会回到上一个位置。我想你有打字错误 更改:
[scrollView addSubview:someview1];
致:
您是否打算创建名为someview但添加子视图:someview1的视图?或者这是你的示例代码中的一个输入错误?现在我只是给你这个代码中的示例…谢谢,但它不起作用,伙计。。。。
[scrollView addSubview:someview];