我在viewDidLoad方法中设置页脚视图:
UIView *fView = [[UIView alloc] initWithFrame:CGRectMake(0, 718, 239, 50)];
fView.backgroundColor =[UIColor yellowColor];
self.table.tableFooterView = fView;
Run Code Online (Sandbox Code Playgroud)
不幸的是,页脚没有在(x,y)上面指定的指定中绘制,但是它坚持使用单元格,因此如果表格视图有4个单元格,则页脚将在第5个单元格中绘制.
我甚至尝试过协议方法, tableView:viewForFooterInSection
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
UIView *fView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 239, 50)];
fView.backgroundColor =[UIColor yellowColor];
return fView;
}
Run Code Online (Sandbox Code Playgroud)
问题没有解决,我确定tableFooterView属性应该在表视图底部的页脚视图但我不确定我可能在这里缺少什么?Thanx提前.