Error: No resource found that matches the given name: attr 'listViewStyle'

时间秒杀一切 提交于 2020-02-01 08:21:31

问题


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>

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'.

I really don't understand why I cannot use listViewStyle attribute.

Source:

http://brainflush.wordpress.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


回答1:


I feel so stupid!

<item name="android:listViewStyle"> 

instead of

<item name="listViewStyle">


来源:https://stackoverflow.com/questions/8193172/error-no-resource-found-that-matches-the-given-name-attr-listviewstyle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!