Android-Slidingmenu-example的配置

試著忘記壹切 提交于 2019-11-29 22:43:08
Slidingmenu目前比较流行,今天自己也从网上找了一些开源的 Slidingmenu实现,主要有项目有:
https://github.com/jfeinstein10/SlidingMenu/
https://github.com/JakeWharton/ActionBarSherlock

因为jfeinstein10的这个SlidingMenu信赖ActionBarSherlock,所有先得下载ActionBarSherlock,
1.下载ActionBarSherlock,并完成配置.
  Setp 1:下载ActionBarSherlock源代码

git clone git://github.com/JakeWharton/ActionBarSherlock.git
  Setp 2:将ActionBarSherlock的Lib导入Eclipse
  下载下来的源代码有好几个目录,使用ActionBarSherlock/actionbarsherlock的项目就行,将一个目录导入Eclipse,导入后这个项目还不是一个android项目,还要修改一下.projectt 和.classpath这两个文件:
将.project修改为:
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
	<name>actionbarsherlock</name>
	<comment></comment>
	<projects>
	</projects>
	<buildSpec>
                <buildCommand>
                        <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
                <buildCommand>
                        <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
                <buildCommand>
                        <name>org.eclipse.jdt.core.javabuilder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
                <buildCommand>
                        <name>com.android.ide.eclipse.adt.ApkBuilder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
        </buildSpec>
        <natures>
                <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
                <nature>org.eclipse.jdt.core.javanature</nature>
        </natures>
</projectDescription>
再修改.classpath文件:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src"/>
	<classpathentry kind="src" path="gen"/>
	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
	<classpathentry kind="lib" path="libs/android-support-v4.jar"/>
	<classpathentry kind="output" path="bin/classes"/>
</classpath>
回到Eclipse里,Clean一下项目actionbarsherlock就可以了...

2.下载SlidingMenu,并完成配置:
Setp 1:下载SlidingMenu源代码

git clone git://github.com/jfeinstein10/SlidingMenu.git


Setp 1:配置SlidingMenu
和ActionBarSherlock的配置一样,只不过要注意的是在使用android-support-v4.jar要引用ActionBarSherlock项目下的Libs里的这个jar包,要导入的项目是SlidingMenu/library
.project与ActionBarSherlock一样,.classpath有一点点不同:
.classpath详细如下:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src"/>
	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
	<classpathentry combineaccessrules="false" kind="src" path="/actionbarsherlock"/>
	<classpathentry kind="src" path="gen"/>
	<classpathentry kind="lib" path="/actionbarsherlock/libs/android-support-v4.jar"/>
	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
	<classpathentry kind="output" path="bin/classes"/>
</classpath>

3.导入SlidingMenu/example项目
修改.project与上两个项目一样,配置.classpath:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src"/>
	<classpathentry kind="src" path="gen"/>
	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
	<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
	<classpathentry combineaccessrules="false" kind="src" path="/actionbarsherlock"/>
	<classpathentry combineaccessrules="false" kind="src" path="/library"/>
	<classpathentry kind="output" path="bin/classes"/>
</classpath>
这个下来项目就可以运行了...









标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!