Is there a way to programmatically scroll to the top of a NestedScrollView by also triggering the scroll events for the parent? smoothScrollTo(x, y)
NestedScrollView
smoothScrollTo(x, y)
Some time NestedScrollView.scrollTo(0, 0); and scrollview.pageScroll(View.FOCUS_UP); does not work
NestedScrollView.scrollTo(0, 0);
scrollview.pageScroll(View.FOCUS_UP);
At that you need to use fling() and smoothScrollTo() together
fling()
smoothScrollTo()
SAMPLE CODE
nestedScrollView.post { nestedScrollView.fling(0) nestedScrollView.smoothScrollTo(0, 0) }