ios - UITableView 页脚未正确定位

标签 ios swift uitableview

我想让我的 UITableView 的页脚保持 float 。

我做对了,但我的问题是,页脚没有显示全部,我必须滚动一点才能看到它,我不知道为什么。

请看,页脚只显示顶部黑色,而不是底部黑色:

enter image description here

在界面生成器中我确实有顶部和底部的黑条 enter image description here

我可以像这样轻松添加页脚:

override func tableView(tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
        return self.footerView
    }

最佳答案

页脚的高度由委托(delegate)方法 heightForFooterInSection 管理。您需要在此方法中传递正确的页脚高度才能完整显示页脚。

在您的实现中,页脚的高度似乎被略微截断了。将高度增加 20 px 后尝试。

关于ios - UITableView 页脚未正确定位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34301891/

相关文章:

ios - 快速为常规按钮提供条形按钮标识符

ios - 如何在开发期间为 iOS 禁用 Crashlytics?

ios - 最佳实践 CoreData - 顺序基元的单独实体或嵌入引用实体中?

ios - 如何使用 willDisplayCell 方法实现多个自定义单元格?

swift - 每次我尝试访问 UITableViewCell 的 textLabel 时都会返回 Nil

ios - 密码字段的键盘仅在 iOS 12 上从 azerty 切换到 qwerty(有时)

iphone - 如何关闭所有模态视图?

ios - Swift - 从导航系统中删除 View Controller

ios - 如何快速获取日期的时间

iOS设置TableView展开TableCell的高度