use*_*678 7 android maven actionbarsherlock
我在使用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>
Run Code Online (Sandbox Code Playgroud)
我的源代码编译很好,但我无法添加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>
Run Code Online (Sandbox Code Playgroud)
这会产生错误"找不到与给定名称匹配的资源".
我应该怎么做才能添加ABS主题?
提前谢谢,Mirco
使用@style/Theme.Sherlock
而不是@android:style/Theme.Sherlock
.
http://developer.android.com/guide/topics/ui/themes.html#ApplyATheme
这篇文章也可能有帮助:
为 Android 应用程序设置 ActionBarSherlock 主题
归档时间: |
|
查看次数: |
320 次 |
最近记录: |