苹果官方例子-scrollView pageControl
例子的关键是使用的延迟加载的思想 ,如uitableview的reuse uitableviewcell一样
for (unsigned i = 0; i < kNumberOfPages; i++) { |
[controllers addObject:[NSNull null]]; |
} |
同时考虑用户体验
[self loadScrollViewWithPage:0]; |
[self loadScrollViewWithPage:1]; |
其他参考:
Detect Single Tap in UIScrollView
ScrollingMadness
---------选择单触事件对象
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
//NSLog(@"tag %@",touch);
if([touch view] == imageView)
{
//Do Something
}
}
UIScrollingView的拖刷效果
http://github.com/enormego/EGOTableViewPullRefresh