Would recyclerview work on an android device with Jellybean?

前端 未结 1 1841
逝去的感伤
逝去的感伤 2021-01-28 10:20

TO display a list of items I am using the latest RecyclerView in my app. I want to know would it only work on devices having android 5.0 or would it on work on lower versions as

相关标签:
1条回答
  • 2021-01-28 10:54

    Yes, it's backwards-compatible, assuming you include the support library for RecyclerView v7 in your application's build.gradle file:

    Make sure you have downloaded the Android Support Repository using the SDK Manager.

    1. Open the build.gradle file for your application.

    2. Add the support library feature project identifier to the dependencies section just like this:

    dependencies {
         ...
         compile "com.android.support:recyclerview-v7:21.0.0.+" 
    }
    

    That one will work down as low as Android 2.1 (API level 7), hence the name v7

    0 讨论(0)
提交回复
热议问题