这是我在布局中添加回收视图时得到的结果。(我已经导入了依赖项)
我的布局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
这是我设置高度和宽度来包装内容的时候:
在这里我看不到常规的回收者视图是这样的:
那么,如何让这个视图重回Android Studio呢?
迄今尝试的解决办法;
1.使缓存无效
2.删除Android Studio 4.0目录中的缓存文件夹
生成>;Clean Project解决了这个问题。