How to import RecyclerView for Android L-preview

前端 未结 22 1545
被撕碎了的回忆
被撕碎了的回忆 2020-12-02 14:55

Trying to use the new RecyclerView from the support library. I downloaded the 20 update for the support library using the SDK manager.

I\'ve added the jar file to th

相关标签:
22条回答
  • 2020-12-02 15:29

    Other answers did not work for me. I had to add this line:

    compile 'com.android.support:recyclerview-v7:21.0.0'

    0 讨论(0)
  • 2020-12-02 15:31
    compile 'com.android.support:recyclerview-v7:24.2.1'
    

    This works for me. Try it.

    0 讨论(0)
  • 2020-12-02 15:31

    My dependencies;

    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        compile 'com.android.support:appcompat-v7:25.1.0'
    
        //RecyclerView dependency
        compile 'com.android.support:recyclerview-v7:25.1.0'
    
        // Instrumentation dependencies use androidTestCompile
        // (as opposed to testCompile for local unit tests run in the JVM)
        androidTestCompile 'junit:junit:4.12'
        androidTestCompile 'com.android.support:support-annotations:25.1.0'
        androidTestCompile 'com.android.support.test:runner:0.5'
        androidTestCompile 'com.android.support.test:rules:0.5'
    }
    

    I added only compile 'com.android.support:recyclerview-v7:25.1.0'. The important thing is to add RecycleView dependency which is as the same version as appcompat

    0 讨论(0)
  • 2020-12-02 15:34

    I have created using following lines and this works for me.

    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    

    For AndroidX

    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    

    For complete tutorial please see here

    0 讨论(0)
  • 2020-12-02 15:36

    RecyclerView can now be added by compiling design dependency in app gradle:

    dependencies {
    ...
    compile 'com.android.support:design:24.0.0'
    }
    
    0 讨论(0)
  • 2020-12-02 15:36

    I used this one is working for me. One thing needs to be consider that what appcompat version you are using. I am using appcompat-v7:26.+ so this is working for me.

    implementation 'com.android.support:recyclerview-v7:26.+'
    
    0 讨论(0)
提交回复
热议问题