SlidingMenu 开源项目下载地址 : https://github.com/jfeinstein10/slidingmenu

Actionbarsherlock 开源项目下载地址 :http://actionbarsherlock.com/download.html

导入步骤如下:

1.将下载的Actionbarsherlock中/actionbarsherlock文件夹复制到workspace(你的项目工作空间),改名为Actionbarssherlock,从eclipse中操作new->project->Android Project from Existing Code将项目添加进去,target改为api14以上。

2.将下载的slidingmenu中/library文件夹复制到workspace(你的项目工作空间),改名SlidingMenu, 从eclipse中操作new->project->Android Project from Existing Code将项目添加进去,target改为Google APIs 14以上。 或者打开project.properties:target=Google Inc.:Google APIs:14或更高。

3.这样SlidingMenu就可以用在自己项目中了。让我们来运行例子。解压slidingmenu中/example。 从eclipse中操作new->project->Android Project from Existing Code将项目添加进去,target改为api14以上。 运行看看效果。2.1以上的系统都可以运行。

导入之后可能会出现的问题如下:

1、 SlidingMenu library project出现错误

  • Console error:  Unable to resolve target ‘Google Inc.:Google APIs:16.

    Fix:   进入 Properties检查Target sdk是否选择了 Google APIs.

  • List of errors:  ACTION_POINTER_INDEX_MASK cannot be resolved android. 
    HONEYCOMB cannot be resolved or is not a field 
    LAYER_TYPE_HARDWARE cannot be resolved or is not a field 
    LAYER_TYPE_NONE cannot be resolved or is not a field 
    MATCH_PARENT cannot be resolved or is not a field 
    The method getLayerType() is undefined for the type View 
    The method setLayerType(int, null) is undefined for the type View

    Fix:  将manifest里面的min sdk version 改为你当前用到的sdk版本,7

2、SlidingMenu  example project出现错误

    • Console error:  Found 2 versions of android-support-v4.jar in the dependency list,but not all the versions are identical (check is based on SHA-1 only at this time). Jar mismatch! Fix your dependencies

      Fix:  这是由于jar包版本不一致导致的,检查SlidingMenu和Actionbarsherlock中的\libs文件夹里的哪个android-support-v4.jar版本比较新,用新的替换掉其中的老版本. 如果错误还是会出现,就clean项目并重启eclipse.

    • List of errors:  The method getSupportActionBar() is undefined for the type BaseActivity 
      The method getSupportMenuInflater() is undefined for the type BaseActivity 
      The method onCreateOptionsMenu(Menu) of type BaseActivity must override or implement a supertype method 
      The method onOptionsItemSelected(MenuItem) in the type Activity is not applicable for the arguments 
      The method onOptionsItemSelected(MenuItem) of type BaseActivity must override or implement a supertype method 
      The method onOptionsItemSelected(MenuItem) of type ResponsiveUIActivity must override or implement a supertype method

      Fix: 打开SlidingMenu library project里SlidingFragmentActivity这个类并在声明前添加以下代码:

    • import com.actionbarsherlock.app.SherlockFragmentActivity;

      然后,将下面这个父类:

    • public class SlidingFragmentActivity extends FragmentActivity implements SlidingActivityBase {

      换成Actionbarsherlock里的另外一个父类(如果此时Library没有引用Actionbarsherlock库项目,则先引用之) :

    • public class SlidingFragmentActivity extends SherlockFragmentActivity implements SlidingActivityBase {

      附上运行效果图之一:

GitHub上最火的开源项目SlidingMenu导入出错的终极解决方案的更多相关文章

  1. 【转】GitHub平台最火Android开源项目整理——2013-08-25 17

    http://game.dapps.net/news/developer/9199.html GitHub在中国的火爆程度无需多言,越来越多的开源项目迁移到GitHub平台上.更何况,基于不要重复造轮 ...

  2. 如何在 Github 上发现优秀的开源项目?

    之前发过一系列有关 GitHub 的文章,有同学问了,GitHub 我大概了解了,Git 也差不多会使用了,但是还是搞不清 GitHub 如何帮助我的工作,怎么提升我的工作效率? 问到点子上了,Git ...

  3. 【转载】如何在 Github 上发现优秀的开源项目?

    之前发过一系列有关 GitHub 的文章,有同学问了,GitHub 我大概了解了,Git 也差不多会使用了,但是还是搞不清 GitHub 如何帮助我的工作,怎么提升我的工作效率? 问到点子上了,Git ...

  4. Golang优秀开源项目汇总, 10大流行Go语言开源项目, golang 开源项目全集(golang/go/wiki/Projects), GitHub上优秀的Go开源项目

    Golang优秀开源项目汇总(持续更新...)我把这个汇总放在github上了, 后面更新也会在github上更新. https://github.com/hackstoic/golang-open- ...

  5. (转载)如何在 Github 上发现优秀的开源项目?

    转载自:传送门 之前发过一系列有关 GitHub 的文章,有同学问了,GitHub 我大概了解了,Git 也差不多会使用了,但是还是搞不清 GitHub 如何帮助我的工作,怎么提升我的工作效率? 问到 ...

  6. GitHub上不错的Android开源项目(三)

    收集相关系列资料,自己用作参考,练习和实践.小伙伴们,总有一天,你也能写出 Niubility 的 Android App :-) GitHub上不错的Android开源项目(一):http://ww ...

  7. GitHub上不错的Android开源项目(二)

    收集相关系列资料,自己用作参考,练习和实践.小伙伴们,总有一天,你也能写出 Niubility 的 Android App :-) 系列文章如下: GitHub上不错的Android开源项目(一):h ...

  8. [转]GitHub上优秀的Go开源项目

    转载于GitHub上优秀的Go开源项目 正文 近一年来,学习和研究Go语言,断断续续的收集了一些比较优秀的开源项目,这些项目都非常不错,可以供我们学习和研究Go用,从中可以学到很多关于Go的使用.技巧 ...

  9. 2018上半年GitHub上最热门的开源项目

    关注GitHub的人都知道,这个平台上面有太多优秀的值得学习的开源项目了,这里总结了2018上半年GitHub上最热门的开源项目. 1: tensorflow https://github.com/t ...

随机推荐

  1. kubernetes kubeadm部署高可用集群

    k8s kubeadm部署高可用集群 kubeadm是官方推出的部署工具,旨在降低kubernetes使用门槛与提高集群部署的便捷性. 同时越来越多的官方文档,围绕kubernetes容器化部署为环境 ...

  2. NSIndexPath初始化

    在UITableView中经常用到这个类,但一直不知道怎么初始化,网上抄录的代码如下,果然好用 NSIndexPath *index = [NSIndexPath indexPathForRow:0 ...

  3. springmvc学习笔记(理论)

    1.springmvc是什么? Spring Web MVC是一种基于Java的实现了Web MVC设计模式的请求驱动类型的轻量级Web框架,即使用了MVC架构模式的思想,将web层 进行职责解耦,基 ...

  4. 本文实例汇总了C#中@的用法,对C#程序设计来说有不错的借鉴价值。

    具体如下: 一 字符串中的用法 1.学过C#的人都知道C# 中字符串常量可以以@ 开头声名,这样的优点是转义序列“不”被处理,按“原样”输出,即我们不需要对转义字符加上 \ (反斜扛),就可以轻松co ...

  5. [转帖]gesture recognition

    http://wenku.baidu.com/view/53c3331a6bd97f192279e9c9.html HSI与RGB的Matlab实现. http://wenku.baidu.com/v ...

  6. jquery中$.ajax的$.get与$.post使用

    <script type='text/javascript' src='http://ajax.useso.com/ajax/libs/jquery/1.7.2/jquery.min.js?ve ...

  7. [PHP学习日志]简单Session的使用

    首先,给出一些Session的解释:目前最实用的网络协议即HTTP超文本传输协议,它是“无状态”的,所谓“无状态”是指它在用户与服务器交互时没有存储需要交互的“状态”.而Session 是在网络应用中 ...

  8. Lang语言包

    \languages\zh_cn\admin\common.php里配置后台所有常量

  9. javascript 判断是否是PC还是手机端

    function IsPC() { var userAgentInfo = navigator.userAgent; var Agents = new Array("Android" ...

  10. php字符串常见面试题

    >> 本文固定链接: http://php.ncong.com/mianshi/mianshiti_string.html >> 转载请注明: 恩聪php 2014年09月02 ...