威望0
积分7976
贡献0
在线时间763 小时
UID1
注册时间2021-4-14
最后登录2024-11-24
管理员
- UID
- 1
- 威望
- 0
- 积分
- 7976
- 贡献
- 0
- 注册时间
- 2021-4-14
- 最后登录
- 2024-11-24
- 在线时间
- 763 小时
|
[mw_shl_code=applescript,true]class ClassName(val list:ArrayList<Type of your list>):RecyclerView.Adapter<ClassName.ViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ClassName.ViewHolder {
val v = LayoutInflater.from(parent.context).inflate(R.layout.item_layout, parent, false)
return ViewHolder(v)
}
override fun getItemCount(): Int {
return list.size
}
override fun onBindViewHolder(holder: ClassName.ViewHolder, position: Int) {
holder.bindItems(list[position])
}
class ViewHolder(itemview: View):RecyclerView.ViewHolder(itemview)
{
fun bindItems(t: type of your list){
}
}
}[/mw_shl_code]
Adapter class for Recyclerview in kotlin android.txt
(698 Bytes, 下载次数: 0)
|
上一篇:CSS Conic Gradient下一篇:Validating a Date Format
|