美文网首页
29.去掉UITableView中多余的表格线

29.去掉UITableView中多余的表格线

作者: noonez | 来源:发表于2016-06-08 17:02 被阅读42次

设置好tableView的tableFooterView

tableView.tableFooterView = UIView(frame: CGRect(x: 0, y: 0, width: 0, height: 0))

最后一行Cell系统分割线顶头,参考:http://blog.sina.com.cn/s/blog_4cd8dd130102v6xq.html

static void setLastCellSeperatorToLeft(UITableViewCell* cell)
{
    if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
        [cell setSeparatorInset:UIEdgeInsetsZero];
    }
    
    if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
        [cell setLayoutMargins:UIEdgeInsetsZero];
    }
    
    if([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]){
        [cell setPreservesSuperviewLayoutMargins:NO];
    }
}

相关文章

网友评论

      本文标题:29.去掉UITableView中多余的表格线

      本文链接:https://www.haomeiwen.com/subject/zpujdttx.html