今天遇到了一个问题,我把持库从25.3.0更新到26.1.0后,发现调用NestedScrollView的smoothScrollTo(0,0)方法,会使NestedScrollView往下滚动到底部。而之前NestedScrollView是顺滑的滚动到顶部。查了下资料,解决了这个问题。
将
scrollView.smoothScrollTo(0, 0);
换成
scrollView.fling(0);
scrollView.smoothScrollTo(0, 0);
–参考
NestedScrollView’s fullScroll(View.FOCUS_UP) not working properly