Recyclerview是否可以在具有Jellybean的android设备上工作? [英] Would recyclerview work on an android device with Jellybean?
问题描述
要显示项目列表,我在我的应用程序中使用的是最新的RecyclerView. 我想知道它只能在具有Android 5.0的设备上运行还是在较低版本上运行?
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 ?
推荐答案
Yes, it's backwards-compatible, assuming you include the support library for RecyclerView v7 in your application's build.gradle
file:
请确保您已使用SDK Manager下载了Android支持资料库.
Make sure you have downloaded the Android Support Repository using the SDK Manager.
-
为您的应用程序打开
build.gradle
文件.
添加支持 库功能项目标识符到依赖项部分,如下所示:
Add the support library feature project identifier to the dependencies section just like this:
dependencies {
...
compile "com.android.support:recyclerview-v7:21.0.0.+"
}
该版本的最低版本将降至Android 2.1(API级别7),因此名称为v7
That one will work down as low as Android 2.1 (API level 7), hence the name v7
这篇关于Recyclerview是否可以在具有Jellybean的android设备上工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!