【发布时间】:2016-08-10 00:39:44
【问题描述】:
我有一个ListView,我想比较我的项目。
如果项目相同,我想为ListView 中的那些项目制作相同的背景颜色。
你能帮帮我吗?
【问题讨论】:
-
我的列表视图中有一个人员列表(姓名和年龄)。我在比较这些人的年龄。如果两个或更多人的年龄相同,我想在这些人的列表视图中放置相同的颜色。
-
AlertDialog alertDialogObject = builder.create(); ListView listView=alertDialogObject.getListView(); listView.setDivider(new ColorDrawable(Color.BLUE));生产者 p1 = null, p2 = null; if(p1.getTour().equals(p2.getTour())){ listView.setBackgroundColor(Color.BLUE); }
标签: android listview background-color