gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:55:01 25 4
gpt4 key购买 nike

看完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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com