亲测可用
- 显示不全问题
- 卡顿问题
显示不全问题解决方案
解决方法就是在RecyclerView外面包裹一层RelativeLayout
并添加android:descendantFocusability属性即可, 代码如下
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/mRecyclerView"
style="@style/NoScrollListViewStyle_1"
tools:listitem="@layout/dispute_create_fragment_upload_attachment_list_item" />
</RelativeLayout>
卡顿问题解决方案
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setNestedScrollingEnabled(false);