我有许多部分的tableview。我正在使用一个实际的tableview单元格,我将其作为自定义节标题使用。我遇到的问题是当我滚动部分标题“棒”到表的顶部,直到下一部分出现。如何防止tableview节头在滚动时粘住?
我怎样才能防止这种情况发生,实际上让它像正常一样向上滚动?
这里是我的代码
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if section == 3 {
let cell = tableView.dequeueReusableCell(withIdentifier: "headerCell") as! HeaderTableViewCell
return cell
}
return UIView()
}
[UITableView的固定栏目标题]的可能的复制(https://stackoverflow.com/questions/17582818/uitableview-with-fixed-section-headers) – Larme
这有点帮助,但是现在我不希望我的tableview被分组,因为它使它看起来不同(有点像设置应用程序)。 – user7097242