数组列表注意的点mutableListOf<ArrayList<Int>>()
//两个数组用于装子视图
private val childArray = mutableListOf<ArrayList<Int>>()
val seChildArray = ArrayList<Int>()
for (i in 0..5){
seChildArray.add(i)
}
childArray.add(seChildArray)
seChildArray.clear()
seChildArray.add(5)
seChildArray.add(6)
Log.v("lfl","${childArray[0].size}") 得出的结果是2
}
当添加到
childArray.add(seChildArray)之后在改变seChildArray中的值,chilArray中的值也会改变