错误:未发现的资源匹配给定的名称:ATTR'listViewStyle“
问题描述:
我想我的主题列表视图的默认主题。
我读了很多的东西在网络上,他们都表示这应该工作:
I am trying to theme my default listview theme. I have read a lot of stuff on the web and they are all saying this should work:
<style name="Theme.MyTheme" parent="@style/Theme.Sherlock.Light">
<item name="textColor">@color/darkblue</item>
<item name="listViewStyle">@style/MyListViewTheme</item>
</style>
与这个主题为ListView:
with this theme for the ListView:
<style name="MyListViewTheme" parent="@android:style/Widget.ListView">
<item name="android:textColor">@color/darkblue</item>
<item name="android:typeface">sans</item>
</style>
不幸的是,我得到这个错误:
Unfortunately, I get this error:
Error: No resource found that matches the given name: attr 'listViewStyle'.
我真的不明白,为什么我不能使用listViewStyle属性。
I really don't understand why I cannot use listViewStyle attribute.
来源:
的http://brainflush.word$p$pss.com/2009/03/15/understanding-android-themes-and-styles/
http://www.devdaily.com/java/jwarehouse/android-examples/platforms/android-2/data/res/values/themes.xml.shtml
答
我觉得这么愚蠢!
<item name="android:listViewStyle">
而不是
<item name="listViewStyle">