gpt4 book ai didi

ios - MBCircularProgressBarView 在 UITableViewCell 中没有动画

转载 作者:行者123 更新时间:2023-11-30 12:22:35 27 4
gpt4 key购买 nike

 //MARK: - TableView Delegate
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

let cell = tableView.dequeueReusableCell(
withIdentifier: "ListOfTaskTableViewCell",
for: indexPath) as! ListOfTaskTableViewCell

//Configuare notification cell
print(self.listItems.count)
cell.lblName?.text = self.listItems[indexPath.row]
cell.lblPersentage?.text = self.listPersentage [indexPath.row]
cell.imgPersentageIcon?.image = UIImage(named: self.listIcons[indexPath.row])
//Set as comment

if self.floatPercentage[indexPath.row] >= 50.0 {
cell.redProgressBar.isHidden = true
UIView.animate(withDuration: 10.0, animations: {
cell.greenProgressBar.value = CGFloat(self.floatPercentage[indexPath.row])
}, completion: nil)

}
else{
cell.greenProgressBar.isHidden = true

UIView.animate(withDuration: 10.0, animations: {
cell.redProgressBar.value = CGFloat(self.floatPercentage[indexPath.row])
}, completion: nil)

}

return cell
}

image

最佳答案

WillDisplayCell中尝试一下

if self.floatPercentage[indexPath.row] >= 50.0 {
cell.redProgressBar.isHidden = true
UIView.animate(withDuration: 10.0, animations: {
cell.greenProgressBar.value = CGFloat(self.floatPercentage[indexPath.row])
}, completion: nil)

}
else{
cell.greenProgressBar.isHidden = true

UIView.animate(withDuration: 10.0, animations: {
cell.redProgressBar.value = CGFloat(self.floatPercentage[indexPath.row])
}, completion: nil)

}

关于ios - MBCircularProgressBarView 在 UITableViewCell 中没有动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44612501/

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