[英]When I Scroll tableview its cell updated automatically How can i stop to update cell?
When I Scroll tableview
its cell updated automatically. 当我滚动
tableview
其单元格会自动更新。
How can i stop to update cell? 我如何停止更新单元格?
My code snippet: 我的代码段:
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
{
let cell = tableview.dequeueReusableCell(withIdentifier: Constant.FAV_CAROUSEL_CELL_IDENTIFIER, for: indexPath) as! carouselFavCell
let objProvider1 = objProvider.providerArr[indexPath.row] as! ProviderModel
self.providerArr = objProvider.providerArr[indexPath.row] as! ProviderModel
self.apointmentArr = objProvider1.appointmentArr
self.serviceArr = objProvider1.serviceArr
cell.caroudelView.reloadData()
cell.caroudelView.type = .linear
cell.caroudelView.tag = indexPath.row
cell.selectionStyle = .none
cell.contentView.backgroundColor = Constant.CELL_BG_COLOR
cell.caroudelView.backgroundColor = Constant.CELL_BG_COLOR
cell.lblProviderName.text = objProvider1.providerName
cell.lblProviderName.textColor = Constant.LBL_TITLE_DARK_GRAY
cell.lblProviderName.font = UIFont.boldSystemFont(ofSize: 15)
cell.btnMenu.setBackgroundImage(UIImage(named: "option1.png"), for: .normal)
cell.buttonAction = { (sender) in
self.providerArr = self.objProvider.providerArr[indexPath.row] as! ProviderModel
self.actionPicker()
}
return cell
}
Try getting rid of the following line: 尝试摆脱以下行:
cell.caroudelView.reloadData()
Without this line, I guess, the cells will only have the value they get when they first appear. 我想如果没有这一行,单元格将仅具有它们首次出现时所获得的值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.