RecyclerView没有出现在Android Studio预览中 [英] RecyclerView doesn't show up in Android Studio Preview
本文介绍了RecyclerView没有出现在Android Studio预览中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我在布局中添加一个recyclerView时得到的.(我已经导入了依赖项)
This is what I am getting when I add a recyclerView in my layout.(I already imported the dependency)
我的布局:
<?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>
这是设置高度和宽度以包装内容的时间:
This is when I set height and width to wrap content:
在这里我看不到常规的回收站视图":
Here I can't see the regular Recycler View like this:
那么,如何在Android Studio上重新获得此视图?
So, how to get this view back on Android Studio?
到目前为止尝试过的解决方案;
Solutions tried so far;
1.使缓存无效
2.删除Android Studio 4.0目录中的Caches文件夹
2.Delete the Caches folder in Android Studio 4.0 directory
推荐答案
构建>清洁项目解决了该问题.
这篇关于RecyclerView没有出现在Android Studio预览中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文