ios - 如何防止内容滚动到 UITableView 页脚后面

标签 ios swift uitableview uiview

现在已经在这个问题上苦苦挣扎了一段时间了:\让我解释一下......首先这是给我带来问题的 UITableViewController 的图片:

enter image description here

UITableViewController 有 3 个动态单元格

  1. 标题 - 绿线以上的所有内容
  2. 主单元 - 所有黑白绿线和红线
  3. 页脚单元格 - 红线下方

我对标题和重复单元格没有问题。我的问题是页脚单元格...womp womp。当我滚动主要内容(即绿线和红线之间的区域)时,内容隐藏在页脚后面。

这是我滚动时的图像 - 请注意底部的两个链接(关于 BVB 和设置已消失) enter image description here

最后这是我的页脚函数:

 override func tableView(tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
    let  footerCell = tableView.dequeueReusableCellWithIdentifier("MenuFooterCell") as! MenuFooterViewCell
    self.tableView.tableFooterView = footerCell
    return footerCell
}

那么我可以做什么来解决这个问题? 非常感谢您的提前帮助:) 如果您给我一个好的答案,我一定会将其标记为正确! -亚历克斯

最佳答案

如果您不想让单元格隐藏在页脚后面: 让您的 FooterView 成为 tableView 中的另一个单元格。

其他:

override func tableView(tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
    return UIView(frame: CGRectZero)
}

关于ios - 如何防止内容滚动到 UITableView 页脚后面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31768318/

相关文章:

ios - NSArray arraywithcontentsfile 的 "invalid"结果

swift - 找出哪个节点(与其他节点共享同一类别位掩码)与我的播放器节点发生碰撞 [Swift & Scenekit]

swift - 转到详细的 TableView Controller

ios - UITableview 到带图像的单元格详细信息

ios - UITableView 中的 TableCell View 未出现在模拟器 iOS7 中

HTML :blur knocking fixed items out of place

ios - Swift:使用本地化的百万和十亿文本格式化货币

ios - iPhone App with account login - 审核流程

objective-c - 隐藏 JSQMessageViewController 气泡中的链接

ios - 在更新 TableView 时,如何使用搜索栏对 NSFetchedResults 数据进行排序,而不会在 fetchedRC.performFetch() 上崩溃?更新