0

How to cancel UIScrollView bounce animation after dragging? ( NOT DISABLE BOUNCE )

Thanks!

debuggenius
  • 449
  • 5
  • 15

3 Answers3

1

some kind effect like dragRefresh? If it is, you should set your scrollView contentInset at scrollView end drag delegate method.

simalone
  • 2,768
  • 1
  • 15
  • 20
0

set the content offset in the scrollView delegate method scrollViewWillEndDragging:withVelocity:targetContentOffset:

- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset;
{
  scrollView.contentOffset = //.. content offset of where you want it to stop, use the current offset if you want it to stay where it is.
}

Your question is vague and doesn't give me much to go on to provide a better answer, hope this is of help.

Oliver Atkinson
  • 7,970
  • 32
  • 43
-1
[scrollView setContentOffset:scrollView.contentOffset animated:NO];

NOTE: You must use the animated version of the function - not the version without the animated flag.

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
Cyril
  • 1