此篇博客仅用来提醒自己以后不要在犯这么简单的错误和帮助遇到此问题的朋友一个解决思路:

报错截图

关于 XmlPullParserException: tag requires a 'drawable' attribute or child tag defining a drawable问题

XML截图:

关于 XmlPullParserException: tag requires a 'drawable' attribute or child tag defining a drawable问题

selector截图:

关于 XmlPullParserException: tag requires a 'drawable' attribute or child tag defining a drawable问题

错误原因:

在设置backgroud属性时,selector的item应该是drawable而不是color,color字段是设置字体颜色的。所以报了以上错误!!

OK,就这么简单!大神轻喷....

相关文章: