无法使用某些 AppCompat 主题和属性
Cant use some AppCompat themes and attributes
我正在使用 AppCompat 支持库,但我无法使用某些主题和属性。
例如,当我尝试使用 Theme.AppCompat.Light.NoActionBar
时出现此错误:
Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.NoActionBar'.
当我尝试使用 colorPrimary
和 colorPrimaryDark
时:
Error: No resource found that matches the given name: attr 'colorPrimary'.
Error: No resource found that matches the given name: attr 'colorPrimaryDark'.
会是什么?
我的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>
问题似乎出在 eclipse 中,我刚刚将我的项目迁移到 Android Studio,这解决了问题。
我正在使用 AppCompat 支持库,但我无法使用某些主题和属性。
例如,当我尝试使用 Theme.AppCompat.Light.NoActionBar
时出现此错误:
Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.NoActionBar'.
当我尝试使用 colorPrimary
和 colorPrimaryDark
时:
Error: No resource found that matches the given name: attr 'colorPrimary'.
Error: No resource found that matches the given name: attr 'colorPrimaryDark'.
会是什么?
我的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>
问题似乎出在 eclipse 中,我刚刚将我的项目迁移到 Android Studio,这解决了问题。