即:
if ([self.tableView numberOfRowsInSection:0] == 0) {
self.tableView.tableFooterView.hidden = NO;
} else {
self.tableView.tableFooterView.hidden = YES;
}
但我希望它能自动更新。
最佳答案
你可以实现这个功能:
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
if ([tableView numberOfRowsInSection:section] == 0) return ***height***;
else return 0;
}
关于ios - 如果 numberOfRowsInSection 为零,是否自动显示 tableFooterView?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17314321/