布局中
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:overScrollMode="never"
android:scrollbars="none"
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:nestedScrollingEnabled="false"/>
</RelativeLayout>
</ScrollView>
kotlin代码中
{
override fun canScrollVertically(): Boolean {
return false
}
}