简体   繁体   English

如何在Intellij Idea上导入滑动菜单?

[英]How to import slidingmenu on Intellij Idea?

I'm using intellij idea. 我正在使用intellij的想法。 As you may know, importing slidingmenu lib into your brand new project is painfully while you're running on eclipse. 您可能知道,当您在eclipse上运行时,将slidemenu lib导入到您的全新项目中会很痛苦。 I did it once but I am using intellij idea anymore and I wonder that is there anybody know how to import and run it succesfully while using Intellij? 我曾经做过一次,但我正在使用intellij想法,我想知道有没有人知道如何在使用Intellij时成功导入和运行它? It is very important to me. 这对我来说非常重要。

I've prepared the sample project using example from the SlidingMenu and ActionBarSherlock . 我准备用示例项目exampleSlidingMenuActionBarSherlock You can grab it here for investigation. 你可以在这里抓住它进行调查。 Open SlidingMenu/example project in IDEA and configure Android 4.1.2 Google APIs SDK. 在IDEA中打开SlidingMenu/example项目并配置Android 4.1.2 Google API SDK。 Build, run in the emulator to test. 构建,在模拟器中运行以进行测试。 The trick was to set the dependencies properly and to change *Activity to Sherlock*Activity in several library classes (per instructions on the SlidingMenu project page). 诀窍是正确设置的依赖关系,并改变*Activity ,以Sherlock*Activity在几个类库(每指令SlidingMenu项目页)。

Dependencies are set as follows: 依赖关系设置如下:

example (main app)
  library (SlidingMenu)
    abs (ActionBarSherlock) (make sure Export is enabled)
      android-support-v4.jar (make sure Export is enabled)
      junit (for ActionBarSherlock tests)

依赖

I just want to add my solution if someone doesn't want to use CrazyCoder code. 如果有人不想使用CrazyCoder代码,我只想添加我的解决方案。 This solution's using IntelliJ on Mac OS X. Here's the steps for noob: 此解决方案在Mac OS X上使用IntelliJ。以下是noob的步骤:

  1. Go to File > Import Module. 转到文件>导入模块。 Select the root directory of your downloaded unzipped SlidingMenu 选择下载的解压缩SlidingMenu的根目录
  2. After importing module, go to File > Project Structure. 导入模块后,转到文件>项目结构。 Select 'Modules' under 'Project Settings', and then select your project name. 选择“项目设置”下的“模块”,然后选择项目名称。 Select Dependencies tab and click '+' sign and choose 'Module Dependency' and pick SlidingMenu module. 选择Dependencies选项卡,然后单击'+'符号并选择'Module Dependency'并选择SlidingMenu模块。
  3. If your project name's module has android-support-v4.jar's dependency, remove that since SlidingMenu has that dependency already 如果您的项目名称的模块具有android-support-v4.jar的依赖项,请删除它,因为SlidingMenu已经具有该依赖项
  4. Select SlidingMenu module and enable export for android-support-v44 (android-support-v4.jar) 选择SlidingMenu模块并为android-support-v44启用导出 (android-support-v4.jar)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM