Kotlin : ListView用法
ListView布局
<ListView
android:id="@+id/list1"
android:layout_width="match_parent"
android:layout_height="match_parent">
</ListView>
适配器
class MyAdapter : BaseAdapter {
var context:Context?=null
var list:ArrayList<Food>?=null
constructor(context: Context,list :ArrayList<Food>){
this.context=context
this.list=list
}
override fun getView