找不到与给定名称匹配的资源:attr'windowBackground' [英] No resource found that matches the given name: attr 'windowBackground'
问题描述
doc 我正在使用没有"android"命名空间的values/styles.xml和带有"android"命名空间的values-v14/styles.xml中的项目.但是在构建values/styles.xml时,它会显示找不到与给定名称匹配的资源:attr'windowBackground'."
As it is said in this doc I am using items in values/styles.xml without "android" namespace and in values-v14/styles.xml with "android" namespace. But when building values/styles.xml it says"No resource found that matches the given name: attr 'windowBackground'."
这是values/styles.xml的代码:
here is the code for values/styles.xml:
<style name="MyDefaultStyle" parent="@style/Theme.AppCompat.Light">
<item name="windowBackground">@color/list_app_background</item>
</style>
这是values-v14/styles.xml的代码:
here is the code for values-v14/styles.xml:
<style name="MyDefaultStyle" parent="@style/Theme.AppCompat.Light">
<item name="android:windowBackground">@color/list_app_background</item>
</style>
推荐答案
这是因为windowBackground来自api 21,所以您应该在其上使用
this is because the windowBackground is from api 21 so u should use it on
values-v21
values-v21
这篇关于找不到与给定名称匹配的资源:attr'windowBackground'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!