我正在以Theme.AppCompat.Light为主题在我的styles.xml文件中使用colorPrimary。我遇到一个没有找到与给定名称匹配的资源: 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>有没有什么我没注意到的?
发布于 2016-03-05 19:05:54
将您的代码更改为:
<item name="android:colorPrimary">#690</item>https://stackoverflow.com/questions/33337507
复制相似问题