Pregunta

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?

¿Fue útil?

Solución

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).

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top