关于UITableView的黑线条


这里採用分组形式。底色可用图片覆盖,设置为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的高度).
【推广】 免费学中医,健康全家人
原文地址:https://www.cnblogs.com/zhchoutai/p/8942707.html