android中的样式xml文件

时间:2014-05-23 17:40:51

标签: android xml

我最近开始研究android,我一直在寻找我的同事代码,以便了解更多信息。

我遇到过这个文件也有错误。

你可以告诉我它是什么以及它做了什么

<resources>

<!--
    Base application theme, dependent on API level. This theme is replaced
    by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
    <!--
        Theme customizations available in newer API levels can go in
        res/values-vXX/styles.xml, while customizations related to
        backward-compatibility can go here.
    -->
</style>

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
    <!-- All customizations that are NOT specific to a particular API-level can go     here. -->
</style>

</resources>

错误在第7行 错误检索项目的父项, 找不到与给定名称匹配的资源&#34; Theme.AppCompat.Light&#34;

2 个答案:

答案 0 :(得分:0)

检查您是否已下载并安装了支持库。链接在这里。希望这可能是你所面临的问题。

Support library

答案 1 :(得分:0)

这是您正在使用的主题文件。
问题是您的项目中可能无法导入库,因此,请执行以下步骤转到

1.File-&gt;导入(android-sdk \ extras \ android \ support \ v7)。选择“appcompat”
 2.Project-&GT;属性 - &GT;机器人。在“添加”部分库中选择“appCompat”
或者如果问题尚未解决,您可以参考这篇文章 No resource found that matches the given name '@style/Theme.AppCompat.Light'