更新时间:2022-09-04 20:52:12
在前面我们介绍了Android 3.0系统引入的ActionBar和如何在3.0以前系统上使用ActionBar. 如果你想在3.0+系统上使用系统的ActionBar而在3.0以前的系统上使用自定义的ActionBar,那么ActionBarSherlock就可以帮助你了.
ActionBarSherlock 是Android compatibility library 的一个扩展, 不知道什么原因 Android 兼容开发包没有包含ActionBar. 所以就有了ActionBarSherlock . 其使用方式和 兼容开发包类似.
下载地址: https://github.com/JakeWharton/ActionBarSherlock/zipball/3.4.2
有两种方式把ActionBarSherlock类库引入到你的项目中,:
<dependency> <groupId>com.actionbarsherlock</groupId> <artifactId>library</artifactId> <version>3.4.2</version> <type>apklib</type> </dependency>
android.support.v4.app.ActionBar android.support.v4.view.Menu android.support.v4.view.MenuItem
这些类的名称和3.0系统中的一样.