问题描述
我想获取显示的UITableViewHeaderFooter视图的框架,但不幸的是
[self.tableView.delegate tableView:self.tableView viewForHeaderInSection:i]
根据其textLabel返回正确的UITableViewHeaderFooter,但是框架全为零:
标题的打印说明:
NSMallocBlock :0x600000af3d20 >>; gestureRecognizers = ;层= >
我可以获得UITableViewCells的有效框架,但没有页眉和页脚。
有什么建议吗?
解决方法
您收到未布置的标题视图,请尝试改用UITableView
方法:
open func rectForHeader(inSection section: Int) -> CGRect
open func rectForFooter(inSection section: Int) -> CGRect