Android 可绘制对象和样式:未找到与 styles.xml 中的名称匹配的资源
Android drawables and style: No resource found that matches name in styles.xml
编译我的应用程序时,出现以下错误:
Error: No resource found that matches the given name: attr 'android:frameDuration'.
Error: No resource found that matches the given name: attr 'android:selectionDividerHeight'.
Error retrieving parent for item: No resource found that matches the given name 'android:style/Widget.QuickContactBadgeSmall.WindowLarge'.
Error: No resource found that matches the given name: attr 'android:foregroundInsidePadding'.
Error: No resource found that matches the given name: attr 'android:listItemLayout'.
Error retrieving parent for item: No resource found that matches the given name 'android:style/Animation.OptionsPanel'.
由于我是新手,所以这对我来说并不明显。
我尝试添加 @android:style/
,甚至删除 @
,但结果没有改变。
这里是 styles.xml
:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Ab" parent="@android:style/Theme.Holo.Light">
<item name="android:dropDownListViewStyle">@style/DropDownListView.Ab</item>
<item name="android:actionBarStyle">@style/ActionBar.Solid.Ab</item>
<item name="android:actionDropDownStyle">@style/DropDownNav.Ab</item>
<item name="android:actionModeBackground">@drawable/cab_background_top_ab</item>
<item name="android:actionBarTabStyle">@style/ActionBarTabStyle.Ab</item>
<item name="android:actionOverflowButtonStyle">@style/OverflowStyle</item>
<item name="android:actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Ab</item>
<item name="android:popupMenuStyle">@style/PopupMenu.Ab</item>
<item name="android:selectionDividerHeight">@drawable/selectable_background_ab</item>
<item name="android:frameDuration">@drawable/cab_background_bottom_ab</item>
</style>
<style name="OverflowStyle" parent="@android:style/Widget.ActionButton.Overflow">
<item name="android:src">@drawable/ic_action_search</item>
</style>
<style name="ActionBar.Solid.Ab" parent="@android:style/Widget.QuickContactBadgeSmall.WindowLarge">
<item name="android:progressBarStyle">@style/ProgressBar.Ab</item>
<item name="android:background">@drawable/gradient_background</item>
<item name="android:listItemLayout">@drawable/transparent</item>
<item name="android:foregroundInsidePadding">@drawable/border_top_tabbar</item>
</style>
<style name="ActionBar.Transparent.Ab" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:progressBarStyle">@style/ProgressBar.Ab</item>
<item name="android:background">@drawable/ab_transparent_ab</item>
</style>
<style name="PopupMenu.Ab" parent="@android:style/Widget.Holo.Light.ListPopupWindow">
<item name="android:popupBackground">@drawable/menu_dropdown_panel_ab</item>
</style>
<style name="DropDownListView.Ab" parent="@android:style/Widget.Holo.Light.ListView.DropDown">
<item name="android:listSelector">@drawable/selectable_background_ab</item>
</style>
<style name="ActionBarTabStyle.Ab" parent="@android:style/Animation.OptionsPanel">
<item name="android:background">@drawable/tab_indicator_ab_ab</item>
</style>
<style name="DropDownNav.Ab" parent="@android:style/Widget.Holo.Light.Spinner">
<item name="android:background">@drawable/spinner_background_ab_ab</item>
<item name="android:dropDownSelector">@drawable/selectable_background_ab</item>
<item name="android:popupBackground">@drawable/menu_dropdown_panel_ab</item>
</style>
<style name="ProgressBar.Ab" parent="@android:style/Widget.Holo.Light.ProgressBar.Horizontal">
<item name="android:progressDrawable">@drawable/progress_horizontal_ab</item>
</style>
<style name="ActionButton.CloseMode.Ab" parent="@android:style/Widget.Holo.Light.ActionButton.CloseMode">
<item name="android:background">@drawable/btn_cab_done_ab</item>
</style>
<style name="Theme.Ab.Widget" parent="@android:style/Theme.Holo">
<item name="android:dropDownListViewStyle">@style/DropDownListView.Ab</item>
<item name="android:popupMenuStyle">@style/PopupMenu.Ab</item>
</style>
</resources>
你能帮我解决这个问题吗?
No resource found that matches the given name: attr 'android:frameDuration'.
No resource found that matches the given name: attr 'android:selectionDividerHeight'.
这两个值都应该是整数,而不是可绘制对象。除此之外,我不确定将这些值应用到主题上是否有意义。持续时间将应用于 ProgressBar
,selectionDividerHeight
应用于 AdapterView
的某些变体,例如 ListView
/ GridView
.
Error retrieving parent for item: No resource found that matches the given name 'android:style/Widget.QuickContactBadgeSmall.WindowLarge'.
不确定...该主题肯定存在。确保使用 @android:style/Widget.QuickContactBadgeSmall.WindowLarge
https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/styles.xml#L784
No resource found that matches the given name: attr 'android:foregroundInsidePadding'.
No resource found that matches the given name: attr 'android:listItemLayout'.
我能找到的关于 insidePadding 的唯一参考说它的值是 true/false,而不是 drawable。
我不确定 listItemLayout
,但是 is a similar attribute only used by the IDE。适配器负责实际膨胀正确的布局。
Error retrieving parent for item: No resource found that matches the given name 'android:style/Animation.OptionsPanel'
同样,这个也存在。
https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/styles.xml#L137
编译我的应用程序时,出现以下错误:
Error: No resource found that matches the given name: attr 'android:frameDuration'.
Error: No resource found that matches the given name: attr 'android:selectionDividerHeight'.
Error retrieving parent for item: No resource found that matches the given name 'android:style/Widget.QuickContactBadgeSmall.WindowLarge'.
Error: No resource found that matches the given name: attr 'android:foregroundInsidePadding'.
Error: No resource found that matches the given name: attr 'android:listItemLayout'.
Error retrieving parent for item: No resource found that matches the given name 'android:style/Animation.OptionsPanel'.
由于我是新手,所以这对我来说并不明显。
我尝试添加 @android:style/
,甚至删除 @
,但结果没有改变。
这里是 styles.xml
:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Ab" parent="@android:style/Theme.Holo.Light">
<item name="android:dropDownListViewStyle">@style/DropDownListView.Ab</item>
<item name="android:actionBarStyle">@style/ActionBar.Solid.Ab</item>
<item name="android:actionDropDownStyle">@style/DropDownNav.Ab</item>
<item name="android:actionModeBackground">@drawable/cab_background_top_ab</item>
<item name="android:actionBarTabStyle">@style/ActionBarTabStyle.Ab</item>
<item name="android:actionOverflowButtonStyle">@style/OverflowStyle</item>
<item name="android:actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Ab</item>
<item name="android:popupMenuStyle">@style/PopupMenu.Ab</item>
<item name="android:selectionDividerHeight">@drawable/selectable_background_ab</item>
<item name="android:frameDuration">@drawable/cab_background_bottom_ab</item>
</style>
<style name="OverflowStyle" parent="@android:style/Widget.ActionButton.Overflow">
<item name="android:src">@drawable/ic_action_search</item>
</style>
<style name="ActionBar.Solid.Ab" parent="@android:style/Widget.QuickContactBadgeSmall.WindowLarge">
<item name="android:progressBarStyle">@style/ProgressBar.Ab</item>
<item name="android:background">@drawable/gradient_background</item>
<item name="android:listItemLayout">@drawable/transparent</item>
<item name="android:foregroundInsidePadding">@drawable/border_top_tabbar</item>
</style>
<style name="ActionBar.Transparent.Ab" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:progressBarStyle">@style/ProgressBar.Ab</item>
<item name="android:background">@drawable/ab_transparent_ab</item>
</style>
<style name="PopupMenu.Ab" parent="@android:style/Widget.Holo.Light.ListPopupWindow">
<item name="android:popupBackground">@drawable/menu_dropdown_panel_ab</item>
</style>
<style name="DropDownListView.Ab" parent="@android:style/Widget.Holo.Light.ListView.DropDown">
<item name="android:listSelector">@drawable/selectable_background_ab</item>
</style>
<style name="ActionBarTabStyle.Ab" parent="@android:style/Animation.OptionsPanel">
<item name="android:background">@drawable/tab_indicator_ab_ab</item>
</style>
<style name="DropDownNav.Ab" parent="@android:style/Widget.Holo.Light.Spinner">
<item name="android:background">@drawable/spinner_background_ab_ab</item>
<item name="android:dropDownSelector">@drawable/selectable_background_ab</item>
<item name="android:popupBackground">@drawable/menu_dropdown_panel_ab</item>
</style>
<style name="ProgressBar.Ab" parent="@android:style/Widget.Holo.Light.ProgressBar.Horizontal">
<item name="android:progressDrawable">@drawable/progress_horizontal_ab</item>
</style>
<style name="ActionButton.CloseMode.Ab" parent="@android:style/Widget.Holo.Light.ActionButton.CloseMode">
<item name="android:background">@drawable/btn_cab_done_ab</item>
</style>
<style name="Theme.Ab.Widget" parent="@android:style/Theme.Holo">
<item name="android:dropDownListViewStyle">@style/DropDownListView.Ab</item>
<item name="android:popupMenuStyle">@style/PopupMenu.Ab</item>
</style>
</resources>
你能帮我解决这个问题吗?
No resource found that matches the given name: attr 'android:frameDuration'. No resource found that matches the given name: attr 'android:selectionDividerHeight'.
这两个值都应该是整数,而不是可绘制对象。除此之外,我不确定将这些值应用到主题上是否有意义。持续时间将应用于 ProgressBar
,selectionDividerHeight
应用于 AdapterView
的某些变体,例如 ListView
/ GridView
.
Error retrieving parent for item: No resource found that matches the given name 'android:style/Widget.QuickContactBadgeSmall.WindowLarge'.
不确定...该主题肯定存在。确保使用 @android:style/Widget.QuickContactBadgeSmall.WindowLarge
https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/styles.xml#L784
No resource found that matches the given name: attr 'android:foregroundInsidePadding'. No resource found that matches the given name: attr 'android:listItemLayout'.
我能找到的关于 insidePadding 的唯一参考说它的值是 true/false,而不是 drawable。
我不确定 listItemLayout
,但是 is a similar attribute only used by the IDE。适配器负责实际膨胀正确的布局。
Error retrieving parent for item: No resource found that matches the given name 'android:style/Animation.OptionsPanel'
同样,这个也存在。
https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/styles.xml#L137