1 <androidx.recyclerview.widget.RecyclerView 2 android:id="@+id/main_recycler" 3 android:layout_width="match_parent" 4 android:layout_height="match_parent"/>
先上效果图:
引入第三方的RecyclerView适配器
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.30'
在MianActivity的布局文件xml中加入RecyclerView控件