Android/ActionBar兼容组件ActionBarSherlock

>>public abstract class ActionBar

extends Object  Added in API level 11

仅支持3.0 以上的设备 并且google未提供该向下兼容包

>>ActionBarSherlock 

由http://actionbarsherlock.com/samples.html提供的开源组件

目的是为了兼容2.*的设备

>>何为兼容2.* ?

这是来自Stackoverflow的一段对话:

>>问:

I am trying to implement SherlockActionbar. I downloaded the project from GitHub and imported the library as a Project and using Android 2.2 as the base SDK.But the Project seems to have a lot of errors.Guess i need to import some other library.

>>答:

You need to compile with Android 3.2. The library needs access to classes from the Honeycomb SDK in order to support it when run on 3.0+ Despite compiling with the newer SDK, you can still support back to Android 2.2 by setting theminSdkVersion to '8'.

>>这里描述的意思 并不是使用2.2的API 向上兼容,而是至少使用3.2的API向下兼容.

补充一句:  在最新版的ActionBarSherlock 需要使用4.0以上的API版本.

>>GitHub Project:

https://github.com/JakeWharton/ActionBarSherlock



解压后的结构如上图


>>Library 包 作为工程包 添加到你的项目中 

需要注意的是 

如果你的项目已经引用了 android-support-v* .

请检查你的兼容包是否一致, 如果不一致会出现Jar dismatch error.

解决方案: 

调整到使用同一Android SDK ,并使用同一个版本的android-support-v*包.

具体的API根据需求具体去研究就可以了  就不赘述了.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值