判断UIScrollView截至滑动

UIScrollView的代办函数(delegate
callout)没有能够判断UIScrollView是否已。这个代码有可以在UIScrollView截至滑动之后触发某个动作。

判断UIScrollView结束滑动

-(void)scrollViewDidScroll:(UIScrollView *)sender
{
    [NSObject cancelPreviousPerformRequestsWithTarget:self];
    //enshore that the end of scroll is fired because apple are twats...
    [self performSelector:@selector(scrollViewDidEndScrollingAnimation:) withObject:nil afterDelay:0.3];
}

-(void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView
{
    [NSObject cancelPreviousPerformRequestsWithTarget:self];
    //do something here
}
//该片段来自于http://outofmemory.cn

//每趟拖拽都晤面回调

– ( void )scrollViewDidEndDragging:( UIScrollView  *)scrollView
willDecelerate:( BOOL )decelerate

{

//decelerate:减速动画,当也YES时,有滑动减速动画,NO时,没有滑动减速动画

if(!decelerate){

//没有放慢动画的早晚,UIScrollView真正截止以当下

}

}

– ( void )scrollViewDidEndDecelerating:( UIScrollView  *)scrollView

{

//有减速动画的时光,UIScrollView真正截止在就

}

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图