在Eclipse中使用支持设计库 [英] Using Support Design Library in Eclipse

本文介绍了在Eclipse中使用支持设计库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作,不幸的是还没有被移植到Android工作室又一个项目。我想利用在谷歌的新support.design库浮动操作按钮,但我不能设法得到它包括在我的项目。

I'm working on a project that unfortunately hasn't been migrated to Android Studio yet. I want to utilize the floating action button in Google's new support.design library but I can't manage to get it included in my project.

我更新在Android SDK管理器的支持库。

I updated the support libraries in the Android SDK Manager.

  • 首先,我试图导入库到Eclipse并用将其添加为一个依赖项目 - >属性 - >上的android我的应用程序而设计的项目没有显示出来为库项目。

  • First I tried importing the library into eclipse and adding it as a dependency using project->properties->android on my app but the design project isn't showing up as a library project.

然后我试图复制的.jar形成 /库/ 设计库目录,包括在我的项目。这让我进口android.support.design.widget.FloatingActionButton; 但是,当我跑的应用程序,它崩溃,因为它无法找到资源安卓.support.design.widget.FloatingActionButton ,不能夸大的XML。

Then I tried copying the .jar form the /libs/ directory of the design library and including that in my project. That allowed me to import android.support.design.widget.FloatingActionButton; but when I ran the app it crashed because it could not find the resource android.support.design.widget.FloatingActionButton and couldn't inflate the xml.

接下来,我尝试添加导入的设计项目到应用程序的构建路径,但我有同样的问题,因为上面。

Next I tried adding the imported design project to the build path of the app but I had the same issue as above.

然后我试图从构建路径工具添加罐子,但我又碰到了XML的问题。

Then I tried adding the jar from the build path tool but again I ran into the xml issue.

我想从我的Andr​​oid SDK中的文件夹添加项目作为外部类文件夹,但没有奏效。

I tried adding project from my android sdk's folder as an external class folder but that didn't work.

我的想法。我意识到我们应该采用Android Studio中,但现在没有什么我可以做的。有谁知道我能得到这个工作在Eclipse?

I'm out of ideas. I realize we should be using Android Studio by now but there's nothing I can do about that. Does anyone know how I could get this working in Eclipse?

推荐答案

通过Eclipse的项目属性对话框(项目>属性),不仅可以连接到一个库项目,但你可以标记一个项目中的的库项目。

Through Eclipse's project properties dialog (Project > Properties), not only can you attach to a library project, but you can mark a project as being a library project.

通常情况下,当您导入一个项目,该信息是从 project.properties 文件拉升。可惜的是,Android的支持设计项目没有一个 project.properties 文件,因此Eclipse的股票导入过程假定要导入的应用程序。

Normally, when you import a project, that information is pulled from the project.properties file. Alas, the Android Support Design Project does not have a project.properties file, and Eclipse's stock import process therefore assumes that you are importing an app.

刚进入项目>属性> Android和标记进口图书馆作为图书馆,通过是库复选框。然后,你可以将它连接到任何希望使用该库的应用程序。

Just go into Project > Properties > Android and mark the imported library as being a library, via the "Is Library" checkbox. Then, you can attach it to the app that wishes to use the library.

请注意,您将需要重复这库废话与图书馆的未来版本中,当您导入这些以取代现有的,当谷歌船舶更新到库中。

Note that you will need to repeat this "Is Library" nonsense with future editions of the library, when you import those to replace your existing one, when Google ships updates to the library.

这一切都头痛会消失,当你切换到Android工作室(添加库要容易得多),但它可能会被新的和令人兴奋的头痛所取代。 : - )

All of this headache will go away when you switch to Android Studio (adding libraries is much easier), though it will probably be replaced by new and exciting headaches. :-)

这篇关于在Eclipse中使用支持设计库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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