OGeek|极客世界-中国程序员成长平台

标题: ios - 为什么tableView不允许滚动查看footerView? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 12:54
标题: ios - 为什么tableView不允许滚动查看footerView?

我已经通过属性为 tableView 设置了一个自定义页脚:

self.tableView.tableFooterView = [self myCustomFooterView];

tableView 几乎填满了屏幕的全高,因此底部只有 1/3 的页脚可见。我已禁用弹跳,并且无法将 tableView 滚动到底部以查看 footerView。如果启用了弹跳,那么我可以弹跳并查看表格页脚,但表格在弹跳后会返回到相同的位置。看起来 tableView 内容大小不包括我的 footerView,这就是我无法滚动的原因。任何想法如何解决这个问题?



Best Answer-推荐答案


JoshHinman 是对的(“检查表格 View 的框架并确保它不大于屏幕。”)。我通过将 MyViewController.view 添加到 AnotherViewController.view 作为 subview 来重用 MyViewController 中包含 tableView 的 AnotherViewController。因为 AnotherViewController.view 包含一些 Logo 图像,所以 MyViewController.view.tableView 被推到底部。正如他指出的那样,问题是我将 tableView 推得太多了

关于ios - 为什么tableView不允许滚动查看footerView?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17850815/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4