由于我Androidstudio版本原因
配置与书中有改变,在此记录
在build.gradle文件添加
dependencies{
implementation "androidx.recyclerview:recyclerview:1.1.0"
}
在xml文件中使用时
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/my_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>