材料设计向后兼容 android:颜色使用 appcompat7 时,需要 API 级别 21
2022-09-01 14:54:25
我在eclipse中有一个maven android项目,即使我已经将我的项目配置为使用兼容性库,它仍然在我的样式中给出以下错误.xml:
android:colorAccent requires API level 21 (current min is 15)
android:colorPrimary requires API level 21 (current min is 15)
android:colorPrimaryDark requires API level 21 (current min is 15)
风格.xml
<style name="AppBaseTheme" parent="Theme.AppCompat"></style>
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:colorPrimary">@color/primary</item>
<item name="android:colorPrimaryDark">@color/primary_dark</item>
<item name="android:colorAccent">@color/accent</item>
</style>
AndroidManifest.xml
package="com.app"
android:versionCode="1"
android:versionName="0.0.1-SNAPSHOT" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity android:name="com.app.activity.MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
啪.xml
<build>
<finalName>${project.artifactId}</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>${android.plugin.version}</version>
<extensions>true</extensions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<sdk>
<platform>21</platform>
</sdk>
</configuration>
</plugin>
</plugins>
</build>
我希望我的应用程序材料设计功能具有向后兼容性支持。我该如何解决这个问题?