UIScrollView *scrollView;
self.scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0,w, h)];
self.scrollView.delegate = self;
self.scrollView.contentSize = CGSizeMake(w, h);
self.scrollView.pagingEnabled = YES;
[self.view addSubview:self.scrollView];
原文地址:http://blog.csdn.net/u011550635/article/details/42461625