找不到与给定名称"android:Theme.Material"匹配的资源

Mak*_*iev 5 android material-design

看完这个答案后,我让RecyclerView在Android 3.0+上运行了它.但styles.xmlvalues-v21仍然导致错误.

主题.

<!-- inherit from the material theme -->
<style name="AppTheme" parent="android:Theme.Material">

    <!-- Main theme colors -->
    <!-- your app's branding color (for the app bar) -->
    <item name="android:colorPrimary">#f00</item>
    <!-- darker variant of colorPrimary (for status bar, contextual app bars) -->
    <item name="android:colorPrimaryDark">#0f0</item>
    <!-- theme UI controls like checkboxes and text fields -->
    <item name="android:colorAccent">#00f</item>
</style>
Run Code Online (Sandbox Code Playgroud)

错误.

错误:检索项目的父项时出错:找不到与给定名称"android:Theme.Material"匹配的资源.

我需要支持Android 3.0.x(API级别11)的Android版本.<uses-sdk android:minSdkVersion="L" android:targetSdkVersion="L" />不是解决方案.

Psy*_*her 2

android:Theme.Material仅支持 API 级别 21。您可以在 android studio 中看到如下错误消息:

android.Theme.Material requires API level 21(current min is 14)
Run Code Online (Sandbox Code Playgroud)