码迷,mamicode.com
首页 > 其他好文 > 详细

关于UITableView的黑线条

时间:2015-07-17 12:16:27      阅读:175      评论:0      收藏:0      [点我收藏+]

标签:uitableview   ios   tableview黑线条   

技术分享

这里采用分组形式,底色可用图片覆盖,设置为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的高度).

版权声明:本文为博主原创文章,未经博主允许不得转载。

关于UITableView的黑线条

标签:uitableview   ios   tableview黑线条   

原文地址:http://blog.csdn.net/u010070526/article/details/46922617

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!