【发布时间】:2014-11-26 18:12:01
【问题描述】:
我使用了 AppCompat 并将 Android 支持库更新到 21.0.2 并将我的项目编译更改为 API 21。之后 Eclipse 在 theme.xml 中显示错误。 它说:
错误:检索项目的父项时出错:找不到资源 匹配给定的名称 'Widget.AppCompat.Light.Base.ActionBar.Solid.Inverse'。
我的themes.xml文件是这样的:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="HamsaThemeDefaultDark" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="icScheduledDrawable">@drawable/ic_drawer_schedule</item>
<item name="icExcludedUpdatesDrawable">@drawable/ic_action_cancel</item>
<item name="icMyAccountDrawable">@drawable/ic_action_accounts</item>
<item name="icRollbackDrawable">@drawable/ic_action_time</item>
<item name="homeLabelbackground">@drawable/app_header_bgd_hamsa_dark</item>
<item name="customRowForegroundHomeLayout">@style/customRowStyleHomeLayout</item>
<item name="backgroundCard">@style/backgroundCardStyleLight</item>
</style>
<style name="HamsaThemeDefaultLight" parent="Theme.AppCompat.Light">
<item name="icScheduledDrawable">@drawable/ic_drawer_schedule</item>
<item name="icExcludedUpdatesDrawable">@drawable/ic_action_cancel</item>
<item name="icMyAccountDrawable">@drawable/ic_action_accounts</item>
<item name="icRollbackDrawable">@drawable/ic_action_time</item>
<item name="homeLabelbackground">@drawable/app_header_bgd_hamsa_light</item>
<item name="customRowForegroundHomeLayout">@style/customRowStyleHomeLayout</item>
<item name="backgroundCard">@style/backgroundCardStyleLight</item>
</style>
<style name="HamsaThemeDefaultLightOverlayActionbar" parent="HamsaThemeDefaultLight">
<item name="android:windowActionBarOverlay">true</item>
<!-- Support library compatibility -->
<item name="windowActionBarOverlay">true</item>
<item name="android:actionBarStyle">@style/MyActionBar</item>
</style>
<style name="MyActionBar" parent="Widget.AppCompat.Light.Base.ActionBar.Solid.Inverse">
<item name="android:background">@android:color/transparent</item>
</style>
<style name="HamsaThemeDefaultLightNoActionBar" parent="@style/Theme.AppCompat.Light">
<item name="android:windowNoTitle">true</item>
</style>
</resources>
我可以为这个问题做些什么? 我已经看到了这些解决方案 Error in styles_base.xml file - android app - No resource found that matches the given name 'android:Widget.Material.ActionButton' , appcompat-v721-0-0-no-resource-found-that-matches-the-given-name-attr-andro 但我仍然有问题。
【问题讨论】:
标签: android xml android-theme