如何导入RecyclerView为Android L- preVIEW [英] How to import RecyclerView for Android L-preview
问题描述
试图用新的RecyclerView从支持库。我使用SDK管理器下载的支持库20的更新。
Trying to use the new RecyclerView from the support library. I downloaded the 20 update for the support library using the SDK manager.
我添加的jar文件到libs文件夹 - 并添加到构建路径 - 使用RecyclerView没有运气
I've added the jar file to the libs folder - and added to build path - no luck using the RecyclerView.
试图根据 Android开发者的API 也用摇篮的依赖 - 没有知道这是正确的地方看 - 这个页面更关系到AndroidTV:
Tried to use also the gradle dependency according to Android Developer's API - not sure if this is the right place to look - this page is related more to AndroidTV :
com.android.support:recyclerview-v7:20.0.+
无法摇篮同步的项目。
Cannot gradle sync the project.
任何想法?
推荐答案
想通了。
您将不得不添加下面的摇篮依赖性:
You'll have to add the following gradle dependency :
compile 'com.android.support:recyclerview-v7:+'
另外一个问题,我已经编译是 compileSdkVersion
。显然,你必须对的android-L编译
another issue I had compiling was the compileSdkVersion
. Apparently you'll have to compile it against android-L
您build.gradle文件看起来应该是这样的:
Your build.gradle file should look something like this:
apply plugin: 'android'
android {
compileSdkVersion 'android-L'
buildToolsVersion '19.1.0'
[...]
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:recyclerview-v7:+'
}
这篇关于如何导入RecyclerView为Android L- preVIEW的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!