gpt4 book ai didi

ios - 当我滚动表格 View 时,其单元格会自动更新,如何停止更新单元格?

转载 作者:行者123 更新时间:2023-11-30 12:26:57 25 4
gpt4 key购买 nike

当我滚动tableview时,它的单元格会自动更新。

我怎样才能停止更新单元格?

我的代码片段:

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
}

最佳答案

尝试删除以下行:

cell.caroudelView.reloadData()

如果没有这一行,我想,单元格将只具有它们第一次出现时获得的值。

关于ios - 当我滚动表格 View 时,其单元格会自动更新,如何停止更新单元格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44063663/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com