【发布时间】:2017-01-21 18:15:01
【问题描述】:
我有以下代码,我需要在视图中显示列表的元素,然后从列表中删除这些项目。我一直在研究 kotlin 中的过滤器与映射,但没有找到解决方案。
var mutableList: MutableList<Object> = myImmutableList.toMutableList()
for (x in mutableList.indices)
{
val tile = row!!.getChildAt(x % 4)
val label = tile.findViewById(android.R.id.text1) as TextView
label.text = mutableList[x].name
val icon = tile.findViewById(android.R.id.icon) as ImageView
picasso.load(mutableList[x].icon).into(icon)
}
【问题讨论】: