我正在使用AppCompat支持库,但我无法使用某些主题和属性。
例如,当我尝试使用Theme.AppCompat.Light.NoActionBar
时,我收到此错误:
检索项目的父项时出错:找不到与给定名称“Theme.AppCompat.Light.NoActionBar”匹配的资源。
当我尝试使用colorPrimary
和colorPrimaryDark
时:
错误:找不到与给定名称匹配的资源:attr'colorPrimary'。
错误:找不到与给定名称匹配的资源:attr'colorPrimaryDark'。
它可能是什么?
my themes.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- the theme applied to the application or activity -->
<style name="CustomActionBarTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">#FF0000</item>
</style>
答案 0 :(得分:0)
问题似乎是在eclipse中,我只是将我的项目迁移到Android Studio,这解决了这个问题。