ArrayAdapter requires the resource ID to be a TextView 的解决办法

来源:互联网 发布:英语小说阅读软件 编辑:程序博客网 时间:2024/06/04 20:04

在使用ArrayAdapter时使用自己写的R.layout.list_item布局容易出现:ArrayAdapter requires the resource ID to be a TextView 报错,而使用android.R.layout.simple_expandable_list_item_1布局则不会....

问题出在:Textview 必须是该布局的根结点 ,将下面一句加入到<TextView>标签里就好了

xmlns:android=http://schemas.android.com/apk/res/android 就是这句了.... 

0 0
原创粉丝点击