如何导入RecyclerView为Android L- preVIEW [英] How to import RecyclerView for Android L-preview

查看:221
本文介绍了如何导入RecyclerView为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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆