我在使用ABS和Maven时遇到了问题.我通过以下方式在POM中添加了ABS支持:
<dependencies> <dependency> <groupId>com.google.android</groupId> <artifactId>android</artifactId> <version>4.0.1.2</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.google.android</groupId> <artifactId>support-v4</artifactId> <version>r10</version> </dependency> <dependency> <groupId>com.actionbarsherlock</groupId> <artifactId>library</artifactId> <version>4.2.0</version> <type>apklib</type> <exclusions> <exclusion> <groupId>com.google.android</groupId> <artifactId>support-v4</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.actionbarsherlock</groupId> <artifactId>library</artifactId> <version>4.2.0</version> <type>jar</type> <exclusions> <exclusion> <groupId>com.google.android</groupId> <artifactId>support-v4</artifactId> </exclusion> </exclusions> </dependency> </dependencies>
我的源代码编译很好,但我无法添加ABS主题,因为没有ABS主题可用.我尝试以下列方式添加主题:
<application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@android:style/Theme.Sherlock" > <activity android:name=".MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application>
提前致谢,
的Mirco
解决方法
使用@ style / Theme.Sherlock而不是@android:style / Theme.Sherlock.
http://developer.android.com/guide/topics/ui/themes.html#ApplyATheme
这篇文章也许有帮助:
Setting ActionBarSherlock Theme for Android app
@H_403_15@ @H_403_15@ 原文链接:https://www.f2er.com/android/314907.html