【安卓开发】ArrayAdapter requires the resource ID to be a TextView

简介: 【安卓开发】ArrayAdapter requires the resource ID to be a TextView

出现这种报错

20200401134307494.png

原因:使用listview时,用arrayadapter的xml网页没有单纯的只包含一个t e x t v i e w

解决方案:使用自带的样式或是再编写一个适配器

20200401134307494.pngandroid.R.layout.simple_spinner_dropdown_item是自带的

listview使用方法

目录
相关文章
|
8天前
|
开发工具 Android开发 git
解决Android AAPT: error: resource android:attr/lStar not found. 问题
解决Android AAPT: error: resource android:attr/lStar not found. 问题
85 0
|
8天前
|
Android开发
【Bug】Android resource linking failed和error: failed linking references.
【Bug】Android resource linking failed和error: failed linking references.
|
Android开发
AAPT: error: resource android:attr/dialogCornerRadius not found.
AAPT: error: resource android:attr/dialogCornerRadius not found.
168 0
|
Android开发
解决bug:在eclipse中导入Android项目时报错: “invalid resource directory name bin/res/crunch”
解决bug:在eclipse中导入Android项目时报错: “invalid resource directory name bin/res/crunch”
461 0
|
Android开发
AAPT: error: resource android:attr/lStar not found.
AAPT: error: resource android:attr/lStar not found.
1479 0
AAPT: error: resource android:attr/lStar not found.
|
Android开发
android studio 查看无效resource
android studio 查看无效resource
android studio 查看无效resource
|
Android开发
【Android】解决TextView.setText提示Do not concatenate text displayed with setText. Use resource string
【Android】解决TextView.setText提示Do not concatenate text displayed with setText. Use resource string =
314 0