Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/196.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Android中为listview中的项目设置不同的背景色_Android_Listview - Fatal编程技术网

如何在Android中为listview中的项目设置不同的背景色

如何在Android中为listview中的项目设置不同的背景色,android,listview,Android,Listview,我所能看到的只是使用“自定义适配器”和“getview”方法 我正在使用arrayadapter从数据库填充列表视图。我们不能使用arrayadapter为listview中的项目设置不同的背景色吗?arrayadapter不是一种适合显示数据库表的结构。改用 在getView中,可以为行或单元格设置任何颜色

我所能看到的只是使用“自定义适配器”和“getview”方法


我正在使用arrayadapter从数据库填充列表视图。我们不能使用arrayadapter为listview中的项目设置不同的背景色吗?

arrayadapter不是一种适合显示数据库表的结构。改用

在getView中,可以为行或单元格设置任何颜色