错误:未发现的资源匹配给定的名称:ATTR'listViewStyle“ [英] Error: No resource found that matches the given name: attr 'listViewStyle'

查看:423
本文介绍了错误:未发现的资源匹配给定的名称: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/

<一个href=\"http://www.devdaily.com/java/jwarehouse/android-examples/platforms/android-2/data/res/values/themes.xml.shtml\" rel=\"nofollow\">http://www.devdaily.com/java/jwarehouse/android-examples/platforms/android-2/data/res/values/themes.xml.shtml

推荐答案

我觉得这么愚蠢!

<item name="android:listViewStyle"> 

而不是

<item name="listViewStyle">

这篇关于错误:未发现的资源匹配给定的名称:ATTR'listViewStyle“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆