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

标签 android material-design

看完this answer ,我做了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>

错误。

Error:Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material'.

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

最佳答案

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

android.Theme.Material requires API level 21(current min is 14)

关于android - 找不到与给定名称 'android:Theme.Material' 匹配的资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25688373/

相关文章:

Android 谷歌分析 xml 文件

android - 是否可以使用 Robolectric 进行集成测试?

jquery - Materialise - DropDown onclick 消失问题

java - 静态最终变量在重建后具有旧值

java - 如何获取 TranslateAnimation 中的位置?

android - 动画适用于 4.0.3 但不适用于 2.3

android - 单击后隐藏 float 操作按钮

javascript - 将 Material UI 的 TouchRipple 组件应用于自定义元素/组件

javascript - 在 AngularJS Material 中使用 ng-table

java - 如何在 Activity 上添加多个 fragment 时划分 android 的 Action bar