2016-02-26 17 views
0

我在Table View Controller中有聯繫人列表。如何確保在表格末尾顯示聯繫人(或單元格)的數量? 我的字典在我的plist細胞在TableView結尾處顯示單元格數量

enter image description here

+0

你嘗試添加一個頁腳表視圖,並在頁腳中顯示的行數?另外,如果你不想讓頁腳漂浮,請嘗試使用分組單元格。 – execv

+0

如何創建頁腳? –

+0

看下面的答案。 – execv

回答

1

使用通過下面的UITableViewDelegate方法表視圖頁腳嘗試:

- (nullable UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section 

返回與表中的行數的標籤。如果您不想讓頁腳浮動,請使用。

看看this更多細節

+0

{ - (可空的UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section〜} 這種方法不適合(或我不能)。因爲我只想創建頁腳並在最後加上 –

+0

我加了這個: 'UIView * fview = [[UIView alloc] initWithFrame:CGRectMake(0,0,375,105)]; fview.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@「footer.png」]]; self.tableView.tableFooterView = fview; ' –

+0

您當然可以使用委託方法爲您的表創建僅腳註。另外,如答案中所述,分組表將在最後顯示標題,非浮動標題。 – execv

相關問題