没用VestedScrollView,RecyclerView外面套一个RelariveView,设置属性 android:descendantFocusability=“blocksDescendants”,就不卡顿了
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/home_recycler_products"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false" />
</RelativeLayout>
通过将RecyclerView嵌套在RelativeLayout中,并设置android:descendantFocusability=blocksDescendants属性,可以有效解决滑动卡顿的问题。

3441

被折叠的 条评论
为什么被折叠?



