eclipse Android SlidingMenu 库安装
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18235957/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android SlidingMenu library installation
提问by sisko
I am trying to follow thistutorial.
我正在尝试按照本教程进行操作。
The aim is to integrate the SlidingMenuandroid library. As per the instructions in the tutorial:
目的是集成SlidingMenuandroid 库。按照教程中的说明:
For non-maven project : Copy library/target/slidingmenu-1.3-SNAPSHOT.jar into the libs directory of your project.
对于非 Maven 项目:将 library/target/slidingmenu-1.3-SNAPSHOT.jar 复制到项目的 libs 目录中。
I don't know how to use Maven and I don't want to introduce another layer of complexity.
我不知道如何使用 Maven,我不想引入另一层复杂性。
So, can anyone please tell me where to locate the library/target/slidingmenu-1.3-SNAPSHOT.jarfile?
那么,谁能告诉我在哪里可以找到library/target/slidingmenu-1.3-SNAPSHOT.jar文件?
UPDATE:
更新:
With the exception of the Maven section, I followed the tutorial completely but got the following single error:
除了 Maven 部分,我完全按照教程进行了操作,但出现了以下单个错误:
slidingmenu cannot be resolved or is not a field
slidingmenu cannot be resolved or is not a field
The error is caused by this line of code:
错误是由这行代码引起的:
slidingMenu.setMenu(R.layout.slidingmenu);
SlideMenu.setMenu(R.layout.slidingmenu);
I'm a newbie but I know that's an issue of a missing resource. What I don't know is if it's related to the Maven issue.
我是新手,但我知道这是缺少资源的问题。我不知道它是否与 Maven 问题有关。
Any suggestions on how to fix it will be greatly appreciated.
任何关于如何修复它的建议将不胜感激。
回答by MiStr
So without implementing maven, all you need to do is download that library from your link on github (here). It is only 4.4 MB.
因此,在不实施 maven 的情况下,您只需从 github 上的链接下载该库(此处)。它只有 4.4 MB。
On that github page, there should be a button that says "Download ZIP".
在那个 github 页面上,应该有一个按钮,上面写着“下载 ZIP”。
Once you save the zip file, open the zip file, and navigate the contents... inside the library folder, you can find the source files of the SlidingMenu solution.
保存 zip 文件后,打开 zip 文件并浏览内容...在库文件夹中,您可以找到 SlidingMenu 解决方案的源文件。
The QUICKEST way to get this into your project is to copy the contents of the libs, res, and srcfolders into the respective folders in your project.
将其放入项目的最快方法是将libs、res和src文件夹的内容复制到项目中的相应文件夹中。
The SlidingMenu project on github cannot merely be a .jar file, since it contains visual assets as well (ie. items in the /res folder are needed).
github 上的 SlidingMenu 项目不仅仅是一个 .jar 文件,因为它也包含视觉资产(即需要 /res 文件夹中的项目)。
Another approach is to create a separate project on your computer named SlidingMenu (create it as a "library" project) and then include this project into your own project as a dependency. The manner in which to do this varies by IDE (Eclipse, IntelliJ, AndroidStudio, etc). Hopefully you're using one of those IDEs.
另一种方法是在您的计算机上创建一个名为 SlidingMenu 的单独项目(将其创建为“库”项目),然后将该项目作为依赖项包含到您自己的项目中。执行此操作的方式因 IDE(Eclipse、IntelliJ、AndroidStudio 等)而异。希望您正在使用其中一种 IDE。