我有以下代码:
func tableView(tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) {
let header: UITableViewHeaderFooterView = view as! UITableViewHeaderFooterView
header.frame.insetInPlace(dx: 55, dy: 0)
}
我将 View 移动到 55 以上,这样它就不会与中心 View 重叠,因为该 View 是右侧面板。一旦我在该侧面板中滚动表格 View ,位置似乎就会恢复,使我的标签在中心 View 下消失。如果我折叠侧面菜单并重新打开它,位置将被重置。我希望 View 保持在 55。我该怎么办?
最佳答案
我决定将整个 subview Controller 移动过来,而不是尝试移动节标题位置。这样我就不需要操纵所有节标题和单元格标签/图标的位置。这对我来说要容易得多。
因此,作为答案,请考虑移动基础 View 。
关于ios - 停止 UITableView 部分标题在滚动时移动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33665548/