在我的项目中使用android.support.v7.widget.CardView(Eclipse中) [英] Using android.support.v7.widget.CardView in my project (Eclipse)

查看:1134
本文介绍了在我的项目中使用android.support.v7.widget.CardView(Eclipse中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用中引入了全新的Andr​​oid大号开发preVIEW支持库(正如前面提到的here ),这似乎是V7支持库的一个新版本的一部分。

I'd like to use the new CardView widget that was introduced with the new Android L Developer Preview Support Library (As mentioned here), which seems to be part of a new revision of the v7 support library.

我现在已经更新了我的SDK版本,下载最新的支持库包,但我仍然无法找到新的CardView小部件。

I have now updated my SDK version, downloaded the newest Support Library package, but I still cannot find the new CardView widget.

我已经在网上搜索和官方的文档,但无法获得在那里我能得到新的支持库中的任何线索。

I already searched the web and the official docs, but could not get any hints on where I can get the new support library.

任何帮助是非常AP preciated!

Any help is highly appreciated!

编辑:我使用ADT / Eclipse的

I'm using ADT/Eclipse

推荐答案

我终于找到了一种方法来使用CardView在ADT / Eclipse中。它实际上是pretty的方便:

I finally found a way to use CardView in ADT/Eclipse. It's actually pretty easy:

  1. 在Android的Studio中创建一个新的项目
  2. 添加在其他的答案中说明的CardView依赖这个问题
  3. 开启ADT并创建一个新的库项目包名称 android.support.v7.cardview
  4. 在删除所有资源ADT自动创建
  5. 找到的爆炸-AAR 文件夹中的Andr​​oid Studio和以下文件复制到这些位置:
    • RES /价值/ values​​.xml 的同一个位置,你的ADT项目
    • classes.jar 的到库/在你的ADT项目
    • 的Andr​​oidManifest.xml 的用它来代替自动生成的清单在ADT
  1. Create a new project in Android Studio
  2. Add the CardView dependency as explained in the other answers to this question
  3. Open ADT and create a new library project with package name android.support.v7.cardview
  4. Delete all resources ADT auto-created
  5. Find the exploded-aar folder in Android Studio and copy the following files to these locations:
    • res/values/values.xml to the same location in your ADT project
    • classes.jar to libs/ in your ADT project
    • AndroidManifest.xml use it to replace the auto-generated manifest in ADT

作为替代不必为了获得AAR的内容创建一个新的Andr​​oid Studio项目,你也可以简单地找到并解压缩AAR从本地Maven回购。只要按照下面提供的安德鲁·陈的步骤。

As an alternative to having to create a new Android Studio project in order to get the AAR's content, you could also simply find and unzip the AAR from the local maven repo. Just follow the steps provided by Andrew Chen below.

请注意CardView库可能无法在源和ADT兼容的形式提供,因为它仍然只是一个preVIEW和制品。因为可能有错误修复和改进之后的版本中,以保持库的重要了最新的,这是很容易使用的摇篮依赖,但使用上面提供的步骤时,必须手动完成。

Please note the CardView library might not be available in source- and ADT-compatible-form because it's still only a preview and a WIP. As there might be bug fixes and improvements in following releases, it's important to keep the library up-to-date, which is easy using the Gradle dependency, but must be done manually when using the steps provided above.

这篇关于在我的项目中使用android.support.v7.widget.CardView(Eclipse中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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