1

How can I detect when a ListView is scrolled?

I tried wrapping the ListView in a ScrollView and using the scroll event on the ScrollView. Doesn't work.

1 Answer 1

2

I've used the PanGesture on a ListView to capture when a user is scrolling up or down.

  const panEvent$ = fromEvent(this.listView, 'pan').pipe(map(
    (event: PanGestureEventData) => event.deltaY
  ));

This will take my listView property and only emit the Y values. you can then determine if they are moving up or down if Y is greater than 0

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.