penn-wang
一位老和尚,他身边聚拢着一帮虔诚的弟子。这一天,他嘱咐弟子每人去南山打一担柴回来。弟子们匆匆行至离山不远的河边,人人目瞪口呆。只见洪水从山上奔泻而下,无论如何也休想渡河打柴了。无功而返,弟子们都有些垂头丧气。唯独一个小和尚与师傅坦然相对。师傅问其故,小和尚从怀中掏出一个苹果,递给师傅说,过不了河,打不了柴,见河边有棵苹果树,我就顺手把树上唯一的一个苹果摘来了。后来,这位小和尚成了师傅的衣钵传人。
- (void) scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
    int index = fabs(_theScrollView.contentOffset.x)/self.view.frame.size.width;
    if(_lastPageIndex == index) {
        _lastPageIndex++;
    } else{
        _lastPageIndex = index;
    }
    if (_lastPageIndex>index){
    //在这里,就是已经在最后一页,继续滚动,则触发你想要的事件。 其实只是add了一个小小的 int。 
    }
}

  下面是scrollview初始化:

    _theScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0.0, 0.0, self.view.frame.size.width, self.view.frame.size.height)];
    _theScrollView.userInteractionEnabled = YES;
    _theScrollView.directionalLockEnabled = YES;
    _theScrollView.pagingEnabled = YES;
    _theScrollView.showsVerticalScrollIndicator = NO;
    _theScrollView.showsHorizontalScrollIndicator = NO;
    _theScrollView.delegate = self;
    _theScrollView.contentSize = CGSizeMake(self.view.frame.size.width*5, self.view.frame.size.height);

  

posted on 2013-01-10 10:31  penn-wang  阅读(698)  评论(0编辑  收藏  举报