关于UITableView的黑线条

来源:互联网 发布:h5 js老虎机抽奖特效 编辑:程序博客网 时间:2024/05/24 06:23


这里采用分组形式,底色可用图片覆盖,设置为cell(是一个view)的子视图,并把cell'的颜色设置为底色

当UITableView的cell没有满屏显示时,就会出现黑线条,我们只需在初始化时,加上下列语句即可

self.tableView.tableFooterView = [[UIViewalloc] init];


并且把foot的view颜色显示为底色,设置为

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section

{

   if (section > _RechargeRecords.count -2 && self.view.frame.size.height >_RechargeRecords.count *160)

    {

        returnself.view.frame.size.height -_RechargeRecords.count *160;

    }

   else

    {

       return 0;

    }

}


注:_RechargeRecords为对象的组数,160是整个section的高度(包括cell和hight的高度).
1 0