布局
<androidx.core.widget.NestedScrollView
android:id="@+id/scroView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_anchorGravity="bottom"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:nestedScrollingEnabled="false"
android:overScrollMode="never" />
</androidx.core.widget.NestedScrollView>
解决方案
scroView.fling(0)
scroView.smoothScrollTo(0,0)
网友评论