private val mInflator: LayoutInflater = LayoutInflater.from(context)
override fun getCount(): Int {
return list.size
}
override fun getItem(position: Int): Any {
return list[position]
}
override fun getItemId(position: Int): Long {
return position.toLong()
}
@SuppressLint("ViewHolder")
override fun getView(position: Int, convertView: View?, parent: ViewGroup): View? {
val spinView = mInflator.inflate(R.layout.spinner_item, null)
val imageView = spinView.findViewById(R.id.img_color) as ImageView
imageView.setImageResource(list[position])
return spinView
}
}
ммм, @SuppressLint
Обсуждают сегодня