我在使用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>
这会产生错误“找不到与给定名称匹配的资源”.
我应该怎么做才能添加ABS主题?
提前致谢,
的Mirco
解决方法
使用@ style / Theme.Sherlock而不是@android:style / Theme.Sherlock.
http://developer.android.com/guide/topics/ui/themes.html#ApplyATheme
这篇文章也许有帮助:
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。