Question

Maybe I made a wrong description for what I want and hence haven't hit any answer, if that's the case please kindly provide a link with solution.

what I want is: I have scrollview, alwaysBounceVertical is set to true. So when the user drags down after the scrollview has already reached top, the scrollview should bounce. More specific: the view moves down as the user drags, and the moment the user releases his finger the scrollview bounces back.

The event I want to catch is the one that the scrollview finishes bouncing back. I want to apply an animation after this point. So could anyone tell me how should I modify which method in UIScrollViewDelegate to catch that event?

Était-ce utile?

La solution

you can just use UIscrollView Delegate methods Apple Documentation and this an example

 - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate {

    if(!decelerate){
     // Do something 
    }

}

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
   // Do something 
}

for your problem you can apply your behaviour on scrollViewDidEndDragging

Autres conseils

i think this methods will help you

- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset NS_AVAILABLE_IOS(5_0);

- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate;
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top