简体   繁体   English

RecyclerView 未显示在 Android Studio 预览版中

[英]RecyclerView doesn't show up in Android Studio Preview

This is what I am getting when I add a recyclerView in my layout.(I already imported the dependency)这就是我在布局中添加 recyclerView 时得到的结果。(我已经导入了依赖项)

My Layout:我的布局:

    <?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>

布局中的 RecyclerView

This is when I set height and width to wrap content:这是我设置高度和宽度来包装内容的时候:

在此处输入图像描述

Here I can't see the regular Recycler View like this:在这里,我看不到像这样的常规回收站视图:

在此处输入图像描述

So, how to get this view back on Android Studio?那么,如何在 Android Studio 上恢复此视图?

Solutions tried so far;迄今为止尝试的解决方案;

1.Invalidate Caches 1.使缓存无效

2.Delete the Caches folder in Android Studio 4.0 directory 2.删除Android Studio 4.0目录下的Caches文件夹

Build > Clean Project solved the issue. Build > Clean Project解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 android studio 3.6.1 中未显示布局预览工具栏 - Layout Preview toolbar doesn't show in android studio 3.6.1 Recyclerview 不显示类似 android studio 外观的项目 - Recyclerview doesn't show the items like on android studio looks 应用预览未显示 - App preview doesn't show up 有没有办法在 Android Studio 编辑器中显示 RecyclerView 内容的预览? - Is there a way to show a preview of a RecyclerView's contents in the Android Studio editor? 有没有办法在 Android Studio 编辑器中将 RecyclerView 的内容预览显示为网格? - Is there a way to show a preview of a RecyclerView's contents as Grid in the Android Studio editor? Android Studio:想要显示项目预览,但它在 RecyclerView 中显示默认信息 - Android Studio: wanna show preview of item but it shows default information in RecyclerView Firestore数据未显示在RecyclerView中 - Firestore data doesn't show up in RecyclerView DividerItemDecoration没有出现在RecyclerView中 - DividerItemDecoration doesn't show up in RecyclerView Recyclerview NetworkImageView(凌空)没有显示出来 - Recyclerview NetworkImageView (volley) doesn't show up 预览不会在启动时显示(Android Studio) - The Preview Doesn't Displayed At The Launching (Android Studio)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM