找不到与给定名称匹配的资源:attr' colorPrimary' Theme.AppCompat.Light

时间:2015-10-26 02:19:12

标签: android

我正在使用colorPrimary在我的styles.xml文件中使用Theme.AppCompat.Light作为我的主题。我遇到了一个匹配给定名称的No资源:attr' colorPrimary'。我使用this question作为参考,但它与我想要的不符。这是我的源代码:

<resources xmlns:android="http://schemas.android.com/apk/res/android">

    <!--
        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.
        -->
        <item name="colorPrimary">#690</item>
    </style>

    <style name="FlipPremiumOpenScreenTheme" 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.
        -->
        <item name="android:windowNoTitle">true</item>
    </style>

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

    <!-- Application theme. -->

</resources>

有什么我忽略的吗?

1 个答案:

答案 0 :(得分:0)

将您的代码更改为:

<item name="android:colorPrimary">#690</item>