这里采用分组形式,底色可用图片覆盖,设置为cell(是一个view)的子视图,并把cell'的颜色设置为底色
当UITableView的cell没有满屏显示时,就会出现黑线条,我们只需在初始化时,加上下列语句即可
self.tableView.tableFooterView = [[UIView alloc] init];
并且把foot的view颜色显示为底色,设置为
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
if (section > _RechargeRecords.count - 2 && self.view.frame.size.height > _RechargeRecords.count * 160)
{
return self.view.frame.size.height - _RechargeRecords.count * 160;
}
else
{
return 0;
}
}
注: _RechargeRecords为对象的组数,160是整个section的高度(包括cell和hight的高度).