首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >AndroidX RecycleView问题- recycleview不显示

AndroidX RecycleView问题- recycleview不显示
EN

Stack Overflow用户
提问于 2019-05-14 06:40:34
回答 1查看 271关注 0票数 -1

我是android初学者,目前正在探索RecycleView。在我在build.gradle中添加了recycleview依赖项之后,我试图将它添加到我的布局中,但我的背景并不像它应该的那样是白色的,而是一种黑色,在屏幕中央显示了一个文本,上面写着- androidx.recyclview.widget.RecycleView。这是与How to use androidx.recyclerview.widget.RecyclerView with tools:listitem?相同的问题,我遵循了那里的说明,但什么也没有发生。有人知道问题出在哪里吗?

我的build.gradle文件

代码语言:javascript
复制
import com.google.gms.googleservices.GoogleServicesPlugin

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.faks_app"
        minSdkVersion 25
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.core:core-ktx:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    implementation 'com.google.firebase:firebase-core:16.0.9'
    implementation 'com.google.firebase:firebase-firestore:19.0.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
}
apply plugin: 'com.google.gms.google-services'
EN

回答 1

Stack Overflow用户

发布于 2019-05-14 06:55:15

android x <androidx.recyclerview.widget.RecyclerView中RecyclerView的标签

确保这就是您在XML中使用的内容。有时,即使它在预览中显示深灰色+类名并不意味着它坏了,有时它就像文件->无效缓存并重新启动,清理项目并尝试运行应用程序一样简单。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56120725

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档