Michael
Michael

Reputation: 1058

NestedScrollView smoothScrollTo(int x, int y) requires two calls

Title explains it all. Any idea why this is happening? To scroll to the top I need to call:

mainScrollView.smoothScrollTo(0, 0)
mainScrollView.smoothScrollTo(0, 0)

Its child is a LinearLayout and I have set

android:fitsSystemWindows="true"
android:fillViewport="true"

Besides, smoothScrollTo is called after a click event. So the scroll view is fully initialized.

Upvotes: 1

Views: 239

Answers (0)

Related Questions