见鬼去吧
我在列表中添加了部分。我总共有 8 个部分。现在在最后一部分我有一行我添加了一个按钮。点击按钮我打开imagepicker
。当我取消选择器时Viewwillappear
,我重新加载 tableview .当我向下滚动到最后一节到底部并转到图像选择器并返回然后重新加载表时调用。现在调用viewforheaderinsection
第 6 节和第 7 节viewforheaderinsection
但第 8 节没有调用它。请告诉我有什么问题它。
下面是第 8 节的代码。
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if tableView == tableViewResult || section == 0 {
let view = FieldsHeaderCell()
view.frame = CGRect.zero
return view
}
var view = FieldsHeaderCell()
if section == 1 {
view = UINib(nibName: "FieldHeaderWithoutDescription", bundle: nil).instantiate(withOwner: self, options: nil)[0] as! FieldsHeaderCell
} else {
view = UINib(nibName: "FieldHeaderCell", bundle: nil).instantiate(withOwner: self, options: nil)[0] as! FieldsHeaderCell
view.subTitleLabel.text = (cvManager.fields[section].title as! headerOfCV).subTitle
}
let progresLblText = Int(round((cvManager.fields[section].title as! headerOfCV).progressPercentage))
let progress = CGFloat(((cvManager.fields[section].title as! headerOfCV).progressPercentage) * 360/100)
self.progress(blockCompletionProgress: view.blockCompletionProgress, progressThickness: 0.7, trackThikness: 0.7, angle: Double(progress), profileProgress: false)
view.blockCompletionProgress.angle = Double(progress)
view.progrssLabel.text = String(format: "%d", progresLblText)
view.titleLabel.text = (cvManager.fields[section].title as! headerOfCV).title
if section == 7 {
view.blockCompletionProgress.isHidden = true
view.progrssLabel.isHidden = true
}
return view
}