2015-03-25 63 views
0

這是我的無人居住的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

回答