Would recyclerview work on an android device with Jellybean?

ぐ巨炮叔叔 提交于 2019-12-20 06:38:53

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/32348624/would-recyclerview-work-on-an-android-device-with-jellybean

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!