Question

It seems that in the UIScrollViewDelegate function

- (void)scrollViewDidScroll:(UIScrollView *)scrollView

sometimes, scrollView.dragging is true even after

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

is called.

Is that somehow expected?

Était-ce utile?

La solution

If willDecelerate of scrollViewDidEndDragging:willDecelerate: is YES, then yes, that's expected. You get scrollViewDidEndDragging when the user lets go of the drag, but dragging doesn't change until the visual scrolling/decelerating is done. Thus, when you let go of a drag, you may see scrollViewDidEndDragging followed by some scrollViewDidScroll (and dragging still YES).

Alternatively, you can check out tracking, which turns to NO as soon as the user lets go (even though the scroll view may still be scrolling).

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top