1 2 3 4 5 6 7 8 9 10 11 12 13 14
| var item:MutableList<myItems> = mutableListOf() val imageIds = arrayOf(R.mipmap.a, R.mipmap.b, R.mipmap.c, R.mipmap.d, R.mipmap.e) var name = arrayOf("超级大帅哥刘甜甜", "还是超级大帅哥刘甜甜", "可爱的橘猫", "性感裸男","周周") var desc = arrayOf("是他是他就是他,我们的大帅哥,刘天天", "是他是他还是他,我们的大帅哥,刘天天", "刘天天最想养的橘猫", "刘天天最喜欢的性感裸男","刘天天最喜欢的大明星周周")
setContentView(R.layout.activity_clickhere) for (i in imageIds.indices) { item.add(myItems(name[i], desc[i], imageIds[i])) }
var list:ListView = findViewById<ListView>(R.id.list) list.adapter = ListViewAdapter(this,item ,Color.WHITE)
|