如何保持FooterInSection底部,UITableView的

问题描述:

这是我的无人居住的UITableView如何看起来像:如何保持FooterInSection底部,UITableView的

https://www.dropbox.com/s/0jkbct6bq5ty3r8/photo%201.PNG?dl=0

如果我滚动足够的这种情况与页脚:

https://www.dropbox.com/s/cq4w1wcupxtad57/photo%202.PNG?dl=0

正如你所看到的,当我向下滚动时,页脚正在跟进。当tableview被填充更多的单元格时,滚动的数量明显减少,这使得这种情况更频繁发生。无论如何要保持它,因为它始终在第一张照片看起来像?

我使用的页脚代码如下所示:

-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section 
{ 
    UIView* view = [UIView new]; 
    [view setBackgroundColor:[UIColor grayColor]]; 
    return view; 
} 

-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section 
{ 
    return 1.0f; 
} 
+0

而不是使用表FooterView,你可以像自定义单元格末尾添加页脚小区。并在'cellForRow'方法中,您可以检查'indexPath.row'并决定是否显示页脚单元格或正常单元格。 – Akhilrajtr 2015-03-25 12:13:45

+0

[tableFooterView属性不能修复表格视图底部的页脚]的可能重复(http://stackoverflow.com/questions/15687370/tablefooterview-property-doesnt-fix-the-footer-at-the-底的最表视图) – atulkhatri 2015-03-25 12:38:08

看一看这个问题,请尝试发布提问之前搜索。

tableFooterView property doesn't fix the footer at the bottom of the table view