确切的过程,新增] jfeinstein10 / SlidingMenu"在Android项目 [英] Exact procedure to add "jfeinstein10 / SlidingMenu" in android project

查看:236
本文介绍了确切的过程,新增] jfeinstein10 / SlidingMenu"在Android项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是全新到Android,我试图实施滑动具有ListView的菜单
滑动手势
,通过一些搜索,我发现 https://github.com/jfeinstein10/SlidingMenu
是我想要的东西,

I am totally new to android, i am trying to implement Sliding Menu having ListView with Swipe Gesture, by some searching i found that https://github.com/jfeinstein10/SlidingMenu is exactly what i want,

有许多与此相关的这些指导如何库项目集成的问题,但他们都不是新的人喜欢我。在github上也给予程序不详细,我所知道的就是如何添加.jar文件,但这个.zip或其他东西都是全新的,我

There are many questions related to this which are guiding how integrate this library with project, but none of them are for new person like me. also procedure given on github is not detailed, all i know is how to add .jar file but this .zip and other things are totally new for me

这是我做了什么,直到尚未;

This is what i have done till yet;


  1. 从上面的链接下载的zip

  2. 提取链接到文件夹

  3. 在Eclipse中文件 - >导入 - >现有项目到工作空间。

现在它显示我包很多误差 library.src.com.slidingmenu.lib.app <​​/ code>

Now it is showing me many error in package library.src.com.slidingmenu.lib.app

例如

申报包com.slidingmenu.lib.app不符合预期的包library.src.com.slidingmenu.lib.app

现在我不知道该怎么办...

now i don't know what to do...

请人指导我如何整合和项目使用这个库正确的详细过程。

please somebody guide me with proper detailed procedure of how to integrate and use this library in project.

谢谢!

推荐答案

好了,花3天同样的问题,我发现了这件事情的具体过程。在 github上该指南的,当然不是入门级的家伙跟我们一样,也没有这样的一步一步教程对于这一点,所以这需要时间。

Well, spending 3 days with same problem I found the exact procedure for this thing. The guide on github is of-course not for entry level guys like us, also there is no such a "step-by-step tutorial" for this, so it took time.

重要提示:我不包括福尔摩斯动作条库,因为我想保持它的简单

Important: I didn't include "Sherlock ActionBar" library, because I want to keep it simple


  • 首先所有更新月食最新的 ADT 或最好的方式,你可以下载的this ADT捆绑,并确认一切都运行在精新 ADTBundle

  • First up all update your eclipse to latest ADT or best way you can download this ADT Bundle, and confirm that everything is running fine in new ADTBundle.

下载最新的邮政编码为jfeinstein10 / SlidingMenu gitHub ,并提取任何你想要的。提取后它必须有内这些文件和文件夹。

Download latest "zip for jfeinstein10 / SlidingMenu" from "gitHub", And extract it anywhere you want. After extraction it must have these files and folders inside.


  • 现在,打开您的Eclipse 文件 - &GT;导入 - &GT; Android的 - &GT;现有的Andr​​oid code进入工作区,浏览到您的文件夹最有可能 SlidingMenu主,你会看到如下

  • Now open your eclipse File -> Import -> Android -> Existing Android Code Into Workspace, Browse to your folder most probably "SlidingMenu-master" and you should see following

完成,如果日食节目,如某些错误无法解析目标然后通过<$ C改变你的目标$ C>右键单击项目 - &GT;属性 - &GT; Android版和检查任何最新的谷歌API 您的SDK有。

Hit Finish, If eclipse shows some error like Unable to resolve target then change your target through Right Click on project -> Properties -> Android and check any latest google API your SDK have.


  • 添加依赖,用鼠标右键单击项目 - &GT;性能 - &GT; Android的 - &GT;图书馆 - &GT;添加 - &GT; SlidingMenuActivity ,并清除这两个项目。

  • Add Dependency, by right clicking on project -> properties -> android -> library -> add -> SlidingMenuActivity, and clear both projects.

水库添加命名为 menu_frame 新的XML布局 - &GT;布局,并在它把以下
框架布局在它的列表视图

Add new XML layout named as menu_frame in your res -> layout and put following in it Put Frame Layout and list view in it.

另外,在你的 mainActivity XML文件中添加的ListView

Also add a ListView in your mainActivity XML file.

现在是时候创建菜单写以下后的setContentView(R code在的onCreate()。 layout.activity_main)

Now it is time to create "Menu" write following code in your onCreate() after setContentView(R.layout.activity_main).

SlidingMenu menu;
menu = new SlidingMenu(this);
menu.setMode(SlidingMenu.LEFT);
menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
menu.setShadowWidth(5);
menu.setFadeDegree(0.0f);
menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
menu.setBehindWidth(200);
menu.setMenu(R.layout.menu_frame);


  • 目前的线条它显示错误preSS CTRL + 1 和进口 com.slidingmenu.lib.SlidingMenu;

    运行你的项目,你应该看到菜单从左边出来

    Run your project and you should see menu coming out from left side

    现在的下一个任务是添加适配器监听器为您的列表视图(即用于主屏幕和菜单)。

    Now the next task is to add adapter and listener for both of your ListViews (i.e for Main-screen and Menu).

    有关在创建菜单你可以参考示例中使用函数的信息的应用程序提供的库或者google他们,有很多可用的信息的。

    For information about function used while creating Menu you can refer to example apps provided with library or google them, there is lot of info available.

    也感谢杰瑞米范斯坦对于这样一个伟大的图书馆

    Also thanks to "Jeremy Feinstein" for such a great library

    这篇关于确切的过程,新增] jfeinstein10 / SlidingMenu&QUOT;在Android项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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