[英]Android : ActionBarSherlock : How do I use the ActionBarSherlock on older versions of Android?
I'm beginning development on an app and I set the target to Android 2.2. 我正在开始开发应用程序,并将目标设置为Android 2.2。 can i use actionbarsherlock in my app?
我可以在我的应用程序中使用actionbarsherlock吗?
I added below code in pom file : 我在pom文件中添加了以下代码:
<dependency>
<groupId>com.google.android</groupId>
<artifactId>support-v4</artifactId>
<version>r7</version>
</dependency>
<dependency>
<groupId>com.actionbarsherlock</groupId>
<artifactId>actionbarsherlock</artifactId>
<version>4.4.0</version>
</dependency>
but my app does not run in my phone with android 2.2 and i have this error : 但是我的应用程序无法在装有Android 2.2的手机中运行,并且出现以下错误:
java.lang.IllegalStateException: You must use Theme.Sherlock, Theme.Sherlock.Light, Theme.Sherlock.Light.DarkActionBar, or a derivative.
but when i set theme one of these appear error that no source found! 但是当我设置主题时,其中之一出现错误,找不到源! I don't know how can i fix this, any body have an idea?
我不知道该如何解决这个问题,任何人都有想法吗?
import SherLock Library and add blow code in styles.xml and AndroidManifest.xml 导入SherLock库并在styles.xml和AndroidManifest.xml中添加打击代码
styles.xml styles.xml
<style name="AppTheme" parent="Theme.Sherlock" />
AndroidManifest.xml AndroidManifest.xml中
<application
...
android:theme="@style/AppTheme" >
<activity
...
</activity>
</application>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.