刷新RecyclerView图片闪烁问题

1、重写适配器带payloads: MutableList 的onBindViewHolder方法

2、刷新适配器使用notifyItemRangeChanged(0,list.size,"任意内容")方法

 override fun onBindViewHolder(p0: ViewHodel, p1: Int, payloads: MutableList) {

        if(payloads.isEmpty()){
            onBindViewHolder(p0, p1, payloads)
        }else{//需要刷新的内容
            val model = list[p1]
            p0.iv_select.isChecked = model.isSelect
        }
    }

3、 onBindViewHolder(p0: ViewHodel, p1: Int) 方法正常加载数据

 

 

你可能感兴趣的:(刷新RecyclerView图片闪烁问题)