如何加上" Android的设计支持库"与ADT-插件到Eclipse? [英] How to add "Android Design Support Library" to Eclipse with ADT-plugin?

查看:252
本文介绍了如何加上" Android的设计支持库"与ADT-插件到Eclipse?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的Andr​​oid开发者博客在宣布2015年5月:

The Android Developers Blog announced in May 2015:

在设计库现已上市,所以一定要在SDK管理器更新Android的支持库。

The Design library is available now, so make sure to update the Android Support Repository in the SDK Manager.

我使用的Eclipse(版本:4.4.2月神)与最新的ADT-插件并没有看到什么设计在SDK管理器:

I am using Eclipse (Version: Luna 4.4.2) with latest ADT-plugin and don't see anything "design" in the SDK manager:

在尝试使用<一个href="https://developer.android.com/reference/android/support/design/widget/FloatingActionButton.html"相对=nofollow> android.support.design.widget.FloatingActionButton 或的 android.support.design.widget.NavigationView 在我的项目像的这个 -

When trying to use android.support.design.widget.FloatingActionButton or android.support.design.widget.NavigationView in my projects like this one -

我遗憾的是得到错误:

产生的原因:抛出java.lang.ClassNotFoundException:没有找到类android.support.design.widget.NavigationView的路径...

Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.design.widget.NavigationView" on path ...

如果我将使用Android的工作室,我可能需要行

If I would be using Android Studio, I probably needed the line

compile 'com.android.support:design:22.2.0'

但如何解决这个问题在Eclipse?我可以下载一个JAR文件的设计库?

but how to fix this in Eclipse? Can I download a JAR file for the design library?

我有搜索 \ SDK \演员\机器人\ SUPPORT \ 路径,但没有发现任何。

I have searched \sdk\extras\android\support\ path, but haven't found any.

推荐答案

使用的设计支持库之前,你必须输入从的Andr​​oid的SDK \额外的支持-V7-appcompat库 \机器人\ SUPPORT \ V7 \ appcompat 的。然后,你必须:

Before use the design support library, you have to import support-v7-appcompat library from android-sdks\extras\android\support\v7\appcompat. Then, you have to:

  • 对于在Eclipse中创建一个Android库项目的设计支持库
  • 把目录中的内容的的Andr​​oid的SDK \演员\机器人\ SUPPORT \设计的在设计支持库项目
  • 链接 appcompat-V7库设计支持库项目
  • 链接支持库从项目的项目。
  • create an android library project in eclipse for design support library
  • put the contents of directory android-sdks\extras\android\support\design in the design support library project
  • Link appcompat-v7 library to design support library project
  • Link support library project from your project.

因为你需要一些资源太(这是AAR格式的原因)。

You can not use directly the jar android-support-design.jar because you need some resources too (this is the reason of aar format).

有关详细信息只是检查<一href="http://stackoverflow.com/questions/26530415/error-in-styles-base-xml-file-android-app-no-resource-found-that-matches-the">Error在styles_bas​​e.xml文件 - Android应用程序 - 无资源的发现,匹配给定的名字'机器人:Widget.Material.ActionButton

For more info just check Error in styles_base.xml file - android app - No resource found that matches the given name 'android:Widget.Material.ActionButton'

这篇关于如何加上&QUOT; Android的设计支持库&QUOT;与ADT-插件到Eclipse?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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